8686 {'name' : 'datetime' , 'type' : types .DATETIME (), 'nullable' : True , 'default' : None },
8787 {'name' : 'time' , 'type' : types .TIME (), 'nullable' : True , 'default' : None },
8888 {'name' : 'bytes' , 'type' : types .BINARY (), 'nullable' : True , 'default' : None },
89- {'name' : 'record' , 'type' : types .JSON (), 'nullable' : True , 'default' : None },
89+ {
90+ 'name' : 'record' ,
91+ 'type' : types .JSON (),
92+ 'nullable' : True ,
93+ 'default' : None ,
94+ 'comment' : 'In Standard SQL this data type is a STRUCT<name STRING, age INT64>.' ,
95+ },
9096 {'name' : 'record.name' , 'type' : types .String (), 'nullable' : True , 'default' : None },
9197 {'name' : 'record.age' , 'type' : types .Integer (), 'nullable' : True , 'default' : None },
9298 {'name' : 'nested_record' , 'type' : types .JSON (), 'nullable' : True , 'default' : None },
@@ -225,8 +231,9 @@ def test_dataset_location(engine_with_location):
225231
226232def test_reflect_select (table , table_using_test_dataset ):
227233 for table in [table , table_using_test_dataset ]:
228- assert len ( table .c ) == 18
234+ assert table .comment == "A sample table containing most data types."
229235
236+ assert len (table .c ) == 18
230237 assert isinstance (table .c .integer , Column )
231238 assert isinstance (table .c .integer .type , types .Integer )
232239 assert isinstance (table .c .timestamp .type , types .TIMESTAMP )
@@ -526,9 +533,10 @@ def test_get_columns(inspector, inspector_using_test_dataset):
526533 for columns in columns_queries :
527534 for i , col in enumerate (columns ):
528535 sample_col = SAMPLE_COLUMNS [i ]
536+ assert col ['comment' ] == sample_col .get ('comment' )
537+ assert col ['default' ] == sample_col ['default' ]
529538 assert col ['name' ] == sample_col ['name' ]
530539 assert col ['nullable' ] == sample_col ['nullable' ]
531- assert col ['default' ] == sample_col ['default' ]
532540 assert col ['type' ].__class__ .__name__ == sample_col ['type' ].__class__ .__name__
533541
534542 columns_without_schema = inspector_using_test_dataset .get_columns ('sample' )
@@ -537,9 +545,10 @@ def test_get_columns(inspector, inspector_using_test_dataset):
537545 for columns in columns_queries :
538546 for i , col in enumerate (columns ):
539547 sample_col = SAMPLE_COLUMNS [i ]
548+ assert col ['comment' ] == sample_col .get ('comment' )
549+ assert col ['default' ] == sample_col ['default' ]
540550 assert col ['name' ] == sample_col ['name' ]
541551 assert col ['nullable' ] == sample_col ['nullable' ]
542- assert col ['default' ] == sample_col ['default' ]
543552 assert col ['type' ].__class__ .__name__ == sample_col ['type' ].__class__ .__name__
544553
545554
0 commit comments