Skip to content

Commit

Permalink
Fix bq extract arg change in upstream (#1504)
Browse files Browse the repository at this point in the history
* fix(google): output is deprecated in BigQueryFacets, outputs should be used instead
* style(core): fix mypy warning
  • Loading branch information
Lee-W authored Apr 10, 2024
1 parent 1bda180 commit 1122caa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions astronomer/providers/core/sensors/filesystem.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from __future__ import annotations

import os
import warnings
from datetime import timedelta
from typing import Any, Dict, Optional
from typing import Any

from airflow.hooks.filesystem import FSHook
from airflow.sensors.filesystem import FileSensor
Expand Down Expand Up @@ -54,7 +56,7 @@ def execute(self, context: Context) -> None:
method_name="execute_complete",
)

def execute_complete(self, context: Context, event: Optional[Dict[str, Any]]) -> None:
def execute_complete(self, context: Context, event: bool | None = None) -> None:
"""
Callback for when the trigger fires - returns immediately.
Relies on trigger to throw an exception, otherwise it assumes execution was
Expand Down
2 changes: 1 addition & 1 deletion astronomer/providers/google/cloud/extractors/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def extract_on_complete(self, task_instance: TaskInstance) -> Optional[TaskMetad

stats = BigQueryDatasetsProvider(client=self._big_query_client).get_facets(bigquery_job_id)
inputs = stats.inputs
output = stats.output
output = stats.outputs
run_facets = stats.run_facets
job_facets = {}
if isinstance(
Expand Down
2 changes: 1 addition & 1 deletion tests/google/cloud/extractors/test_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_extract_on_complete(
job_id=job_id, error_result=False
)
mock_bg_dataset_provider.return_value = BigQueryFacets(
run_facets=RUN_FACETS, inputs=INPUT_STATS, output=OUTPUT_STATS
run_facets=RUN_FACETS, inputs=INPUT_STATS, outputs=OUTPUT_STATS
)

task_id = "insert_query_job"
Expand Down

0 comments on commit 1122caa

Please sign in to comment.