Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro committed May 7, 2024
1 parent 14da212 commit 2bf58cc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ def execute(self, context: "Context"):
db = create_database(self.dataset.conn_id)
self.table = db.get_table_qualified_name(self.dataset)
self.conn_id = self.dataset.conn_id
# apache-airflow-providers-common-sql == 1.2.0 which is compatible with airflow 2.2.5 implements the self.sql
# differently compared to apache-airflow-providers-common-sql == 1.3.3
try:
self.sql = f"SELECT check_name, check_result FROM ({self._generate_sql_query()}) AS check_table"
except AttributeError:
self.sql = f"SELECT * FROM {self.table};"
self.sql = f"SELECT check_name, check_result FROM ({self._generate_sql_query()}) AS check_table"
super().execute(context)

def get_db_hook(self) -> Any:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from astro import sql as aql
from astro.constants import Database
from astro.files import File
from astro.table import Table
from tests.sql.operators import utils as test_utils

CWD = pathlib.Path(__file__).parent
Expand All @@ -22,7 +21,6 @@
{
"database": Database.BIGQUERY,
"file": File(path=str(CWD) + "/../../../data/data_validation.csv"),
# "table": Table(conn_id="gcp_conn_project"),
},
{
"database": Database.POSTGRES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from astro import sql as aql
from astro.constants import Database
from astro.files import File
from astro.table import Table
from tests.sql.operators import utils as test_utils

CWD = pathlib.Path(__file__).parent
Expand All @@ -22,7 +21,6 @@
{
"database": Database.BIGQUERY,
"file": File(path=str(CWD) + "/../../../data/homes_main.csv"),
# "table": Table(conn_id="gcp_conn_project"),
},
{
"database": Database.POSTGRES,
Expand Down

0 comments on commit 2bf58cc

Please sign in to comment.