@@ -800,7 +800,7 @@ def test_default_path(self, mocker):
800
800
class TestBigQueryConnector :
801
801
def test_from_response_json (self , backend_fixtures ):
802
802
# Arrange
803
- json = backend_fixtures ["storage_connector" ]["get_big_query " ]["response" ]
803
+ json = backend_fixtures ["storage_connector" ]["get_big_query_table " ]["response" ]
804
804
805
805
# Act
806
806
sc = storage_connector .StorageConnector .from_response_json (json )
@@ -815,7 +815,6 @@ def test_from_response_json(self, backend_fixtures):
815
815
assert sc .dataset == "test_dataset"
816
816
assert sc .query_table == "test_query_table"
817
817
assert sc .query_project == "test_query_project"
818
- assert sc .materialization_dataset == "test_materialization_dataset"
819
818
assert sc .arguments == {"test_name" : "test_value" }
820
819
821
820
def test_from_response_json_basic_info (self , backend_fixtures ):
@@ -850,7 +849,7 @@ def test_credentials_base64_encoded(self, mocker, backend_fixtures, tmp_path):
850
849
credentialsFile = tmp_path / "bigquery.json"
851
850
credentialsFile .write_text (credentials )
852
851
853
- json = backend_fixtures ["storage_connector" ]["get_big_query " ]["response" ]
852
+ json = backend_fixtures ["storage_connector" ]["get_big_query_table " ]["response" ]
854
853
if isinstance (tmp_path , WindowsPath ):
855
854
json ["key_path" ] = "file:///" + str (credentialsFile .resolve ()).replace (
856
855
"\\ " , "/"
@@ -891,9 +890,7 @@ def test_query_validation(self, mocker, backend_fixtures, tmp_path):
891
890
credentials = '{"type": "service_account", "project_id": "test"}'
892
891
credentialsFile = tmp_path / "bigquery.json"
893
892
credentialsFile .write_text (credentials )
894
- json = backend_fixtures ["storage_connector" ]["get_big_query" ]["response" ]
895
- # remove property for query
896
- json .pop ("materialization_dataset" )
893
+ json = backend_fixtures ["storage_connector" ]["get_big_query_table" ]["response" ]
897
894
if isinstance (tmp_path , WindowsPath ):
898
895
json ["key_path" ] = "file:///" + str (credentialsFile .resolve ()).replace (
899
896
"\\ " , "/"
@@ -905,3 +902,15 @@ def test_query_validation(self, mocker, backend_fixtures, tmp_path):
905
902
# Assert
906
903
with pytest .raises (ValueError ):
907
904
sc .read (query = "select * from" )
905
+
906
+ def test_connector_options (self , backend_fixtures ):
907
+ # Arrange
908
+ engine .set_instance ("python" , python .Engine ())
909
+ json = backend_fixtures ["storage_connector" ]["get_big_query_query" ]["response" ]
910
+ sc = storage_connector .StorageConnector .from_response_json (json )
911
+
912
+ # Act
913
+ options = sc .connector_options ()
914
+
915
+ # Assert
916
+ assert options ["project_id" ] == "test_parent_project"
0 commit comments