def test_get_extract_parameters(self):
    output_config = {
      'path': 'test_path_%(_ts_month)s',
      'table': 'test_table_%(_ts_month)s',
    }
    actual_extract_config = bq._get_extract_parameters('foo_execute_task', None, None,
                                                       output_config)
    expected_extract_config = {
      'type': 'pydatalab.bq.extract',
      'up_stream': ['foo_execute_task'],
      'path': 'test_path_%(_ts_month)s',
      'table': 'test_table_%(_ts_month)s',
    }

    self.assertDictEqual(actual_extract_config, expected_extract_config)

    input_config = {
      'table': 'test_table_%(_ts_month)s',
    }
    output_config = {
      'path': 'test_path_%(_ts_month)s',
    }
    actual_extract_config = bq._get_extract_parameters('foo_execute_task', input_config, None,
                                                       output_config)
    self.assertDictEqual(actual_extract_config, expected_extract_config)
Exemple #2
0
    def test_get_extract_parameters(self):
        output_config = {
            'path': 'test_path_%(_ts_month)s',
            'table': 'test_table_%(_ts_month)s',
        }
        actual_extract_config = bq._get_extract_parameters(
            'foo_execute_task', None, None, output_config)
        expected_extract_config = {
            'type': 'pydatalab.bq.extract',
            'up_stream': ['foo_execute_task'],
            'path': 'test_path_%(_ts_month)s',
            'table': 'test_table_%(_ts_month)s',
        }

        self.assertDictEqual(actual_extract_config, expected_extract_config)

        input_config = {
            'table': 'test_table_%(_ts_month)s',
        }
        output_config = {
            'path': 'test_path_%(_ts_month)s',
        }
        actual_extract_config = bq._get_extract_parameters(
            'foo_execute_task', input_config, None, output_config)
        self.assertDictEqual(actual_extract_config, expected_extract_config)
  def test_get_extract_parameters(self):
    input_config = {
      'path': 'test_path',
      'table': 'test_table',
    }
    actual_extract_config = bq._get_extract_parameters('foo_execute_task', input_config)
    expected_extract_config = {
      'type': 'pydatalab.bq.extract',
      'up_stream': ['foo_execute_task'],
      'format': 'csv',
      'csv_options': None,
      'path': 'test_path',
      'table': 'test_table',
    }

    self.assertDictEqual(actual_extract_config, expected_extract_config)