File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1019,6 +1019,9 @@ def _build_resource(self, filter_fields):
1019
1019
def __repr__ (self ):
1020
1020
return "Table({})" .format (repr (self .reference ))
1021
1021
1022
+ def __str__ (self ):
1023
+ return f"{ self .project } .{ self .dataset_id } .{ self .table_id } "
1024
+
1022
1025
1023
1026
class TableListItem (_TableBase ):
1024
1027
"""A read-only table resource from a list operation.
Original file line number Diff line number Diff line change 27
27
28
28
import google .api_core .exceptions
29
29
30
+ from google .cloud .bigquery .table import TableReference
31
+
30
32
from google .cloud import bigquery_storage
31
33
from google .cloud .bigquery_storage_v1 .services .big_query_read .transports import (
32
34
grpc as big_query_read_grpc_transport ,
@@ -1410,6 +1412,11 @@ def test___repr__(self):
1410
1412
)
1411
1413
self .assertEqual (repr (table1 ), expected )
1412
1414
1415
+ def test___str__ (self ):
1416
+ dataset = DatasetReference ("project1" , "dataset1" )
1417
+ table1 = self ._make_one (TableReference (dataset , "table1" ))
1418
+ self .assertEqual (str (table1 ), "project1.dataset1.table1" )
1419
+
1413
1420
1414
1421
class Test_row_from_mapping (unittest .TestCase , _SchemaBase ):
1415
1422
You can’t perform that action at this time.
0 commit comments