Skip to content

Commit d4e1abf

Browse files
authored
Remove unused code (#3326)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change Remove unused code ## Are these changes tested? N/A ## Are there any user-facing changes? No <!-- In the case of user-facing changes, please add the changelog label. -->
1 parent 0f10a97 commit d4e1abf

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

pyiceberg/catalog/bigquery_metastore.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ def create_table(
132132

133133
dataset_name, table_name = self.identifier_to_database_and_table(identifier)
134134

135-
dataset_ref = DatasetReference(project=self.project_id, dataset_id=dataset_name)
136135
location = self._resolve_table_location(location, dataset_name, table_name)
137136
provider = load_location_provider(table_location=location, table_properties=properties)
138137
metadata_location = provider.new_table_metadata_file_location()
@@ -172,9 +171,7 @@ def create_namespace(self, namespace: str | Identifier, properties: Properties =
172171
try:
173172
dataset_ref = DatasetReference(project=self.project_id, dataset_id=database_name)
174173
dataset = Dataset(dataset_ref=dataset_ref)
175-
dataset.external_catalog_dataset_options = self._create_external_catalog_dataset_options(
176-
self._get_default_warehouse_location_for_dataset(database_name), properties, dataset_ref
177-
)
174+
dataset.external_catalog_dataset_options = self._create_external_catalog_dataset_options(properties, dataset_ref)
178175
self.client.create_dataset(dataset)
179176
except Conflict as e:
180177
raise NamespaceAlreadyExistsError("Namespace {database_name} already exists") from e
@@ -195,7 +192,6 @@ def load_table(self, identifier: str | Identifier) -> Table:
195192
Raises:
196193
NoSuchTableError: If a table with the name does not exist, or the identifier is invalid.
197194
"""
198-
database_name, table_name = self.identifier_to_database_and_table(identifier, NoSuchTableError)
199195
dataset_name, table_name = self.identifier_to_database_and_table(identifier, NoSuchTableError)
200196

201197
try:
@@ -363,7 +359,7 @@ def _create_external_catalog_table_options(self, location: str, parameters: dict
363359
)
364360

365361
def _create_external_catalog_dataset_options(
366-
self, default_storage_location: str, metadataParameters: dict[str, Any], dataset_ref: DatasetReference
362+
self, metadataParameters: dict[str, Any], dataset_ref: DatasetReference
367363
) -> ExternalCatalogDatasetOptions:
368364
return ExternalCatalogDatasetOptions(
369365
default_storage_location_uri=self._get_default_warehouse_location_for_dataset(dataset_ref.dataset_id),

0 commit comments

Comments
 (0)