This is an automated email from the ASF dual-hosted git repository.

shahar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 5689d64911 Undo partition exclusion from the table name when splitting 
a full BigQuery table name (#42541)
5689d64911 is described below

commit 5689d64911fbfd5176fc129f06e7483cc5e4ed03
Author: max <[email protected]>
AuthorDate: Fri Sep 27 10:57:14 2024 +0000

    Undo partition exclusion from the table name when splitting a full BigQuery 
table name (#42541)
---
 airflow/providers/google/cloud/hooks/bigquery.py    | 4 ----
 tests/providers/google/cloud/hooks/test_bigquery.py | 7 ++-----
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/airflow/providers/google/cloud/hooks/bigquery.py 
b/airflow/providers/google/cloud/hooks/bigquery.py
index b1aed15c45..5f8881f458 100644
--- a/airflow/providers/google/cloud/hooks/bigquery.py
+++ b/airflow/providers/google/cloud/hooks/bigquery.py
@@ -2418,10 +2418,6 @@ class BigQueryHook(GoogleBaseHook, DbApiHook):
                 f"{var_print(var_name)}Expect format of 
(<project.|<project:)<dataset>.<table>, "
                 f"got {table_input}"
             )
-
-        # Exclude partition from the table name
-        table_id = table_id.split("$")[0]
-
         if project_id is None:
             if var_name is not None:
                 self.log.info(
diff --git a/tests/providers/google/cloud/hooks/test_bigquery.py 
b/tests/providers/google/cloud/hooks/test_bigquery.py
index 81db43c0f5..02f442cfc7 100644
--- a/tests/providers/google/cloud/hooks/test_bigquery.py
+++ b/tests/providers/google/cloud/hooks/test_bigquery.py
@@ -1034,7 +1034,6 @@ class TestBigQueryHookMethods(_BigQueryBaseTestClass):
         with pytest.raises(ValueError, match="INTERNAL: No default project is 
specified"):
             self.hook.split_tablename("dataset.table", None)
 
-    @pytest.mark.parametrize("partition", ["$partition", ""])
     @pytest.mark.parametrize(
         "project_expected, dataset_expected, table_expected, table_input",
         [
@@ -1045,11 +1044,9 @@ class TestBigQueryHookMethods(_BigQueryBaseTestClass):
             ("alt1:alt", "dataset", "table", "alt1:alt:dataset.table"),
         ],
     )
-    def test_split_tablename(
-        self, project_expected, dataset_expected, table_expected, table_input, 
partition
-    ):
+    def test_split_tablename(self, project_expected, dataset_expected, 
table_expected, table_input):
         default_project_id = "project"
-        project, dataset, table = self.hook.split_tablename(table_input + 
partition, default_project_id)
+        project, dataset, table = self.hook.split_tablename(table_input, 
default_project_id)
         assert project_expected == project
         assert dataset_expected == dataset
         assert table_expected == table

Reply via email to