Пример #1
0
 def test_view_temp_relation(self):
     kwargs = {
         'type': None,
         'path': {
             'project': 'test-project',
             'schema': 'test_schema',
             'identifier': 'my_view'
         },
         'table_name': 'my_view__dbt_tmp',
         'quote_policy': {
             'identifier': False
         }
     }
     BigQueryRelation(**kwargs)
Пример #2
0
 def test_view_relation(self):
     kwargs = {
         'type': 'view',
         'path': {
             'project': 'test-project',
             'schema': 'test_schema',
             'identifier': 'my_view'
         },
         'table_name': 'my_view',
         'quote_policy': {
             'identifier': True,
             'schema': True
         }
     }
     BigQueryRelation(**kwargs)
Пример #3
0
 def test_external_source_relation(self):
     kwargs = {
         'type': 'external',
         'path': {
             'project': 'test-project',
             'schema': 'test_schema',
             'identifier': 'sheet'
         },
         'table_name': 'sheet',
         'quote_policy': {
             'identifier': True,
             'schema': True
         }
     }
     BigQueryRelation(**kwargs)
Пример #4
0
 def test_invalid_relation(self):
     kwargs = {
         'type': 'invalid-type',
         'path': {
             'project': 'test-project',
             'schema': 'test_schema',
             'identifier': 'my_invalid_id'
         },
         'table_name': 'my_invalid_id',
         'quote_policy': {
             'identifier': False,
             'schema': True
         }
     }
     with self.assertRaises(dbt.exceptions.ValidationException):
         BigQueryRelation(**kwargs)
Пример #5
0
def _stub_relation(*args, **kwargs):
    return BigQueryRelation.create(database='',
                                   schema='',
                                   identifier='',
                                   quote_policy={},
                                   type=BigQueryRelation.Table)