Kamran-imaz opened a new issue, #60096:
URL: https://github.com/apache/airflow/issues/60096
### Apache Airflow Provider(s)
google
### Versions of Apache Airflow Providers
_No response_
### Apache Airflow version
3.2.0
### Operating System
Windows (local development)
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
_No response_
### What happened
1. While reviewing **BigQueryUpdateTableSchemaOperator**, I noticed that
**get_openlineage_facets_on_complete** assumes **_table** is always populated.
If the hook returns None, this can raise an exception during the OpenLineage
callback.
2. Moving the Imports mentioned in the method to upwards
3. Mentioning type annotate return.
def execute(self, context: Context): to def execute(self, context: Context)
-> dict | None:
### What you think should happen instead
_No response_
### How to reproduce
1. Use Apache Airflow with the Google provider installed.
2. Enable OpenLineage.
3. Create a DAG that uses BigQueryUpdateTableSchemaOperator.
4. Pass an empty list or no-op schema update to `schema_fields_updates`
(for example, an empty list `[]` or updates that do not modify the table).
5. Trigger the DAG.
Example:
BigQueryUpdateTableSchemaOperator(
task_id="update_schema",
dataset_id="test_dataset",
table_id="test_table",
schema_fields_updates=[],
)
6. The operator execution completes, but `update_table_schema` may return
`None`.
7. After task execution, `get_openlineage_facets_on_complete` is invoked and
assumes the table resource is always present.
8. This can result in an exception when calling
`Table.from_api_repr(self._table)`.
### Anything else
_No response_
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]