You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "SHIVANSH-ux-ys (via GitHub)" <gi...@apache.org> on 2026/09/15 02:40:55 UTC
[PR] Fix BigQueryHook.create_table table_resource type handling (#73091) [airflow]
SHIVANSH-ux-ys opened a new pull request, #73155:
URL: https://github.com/apache/airflow/pull/73155
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
### Description
Fixes #73091.
`BigQueryHook.create_table()` documents and type-hints `table_resource` as `dict[str, Any] \| Table \| TableReference \| TableListItem`. However, passing a `Table`, `TableReference`, or `TableListItem` object raises a `TypeError` due to invalid `from_api_repr()` and `**`-unpacking logic.
This PR fixes `create_table()` by converting `Table`, `TableReference`, and `TableListItem` objects to their API dictionary representation via `.to_api_repr()` prior to resolving table references, and ensures `table_resource_final` is passed to `Table.from_api_repr()`.
Unit tests covering `Table` and `TableReference` instances in `create_table()` are added.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix BigQueryHook.create_table table_resource type handling (#73091) [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on PR #73155:
URL: https://github.com/apache/airflow/pull/73155#issuecomment-5680597609
The following PRs (#73155, #72773, #72463, #72405, #72355, and #72354) do not comply with the GenAI-Assisted Contributions guidelines. They lack the required AI-usage declaration and contain unrelated or low-quality changes that unnecessarily consume maintainer review time.
These PRs will therefore be closed. Please read and follow `contributing-docs/05_pull_requests.rst` before submitting any further contributions.
Any future failure to follow these guidelines will be handled under the project’s Community Escalation process (`COMMUNITY_ESCALATION.md`). This may result in being blocked from contributing to Apache Airflow and, in sustained or cross-project cases, an ASF Infrastructure-level block.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix BigQueryHook.create_table table_resource type handling (#73091) [airflow]
Posted by "roykoand (via GitHub)" <gi...@apache.org>.
roykoand commented on code in PR #73155:
URL: https://github.com/apache/airflow/pull/73155#discussion_r4012490366
##########
shared/configuration/src/airflow_shared/configuration/parser.py:
##########
@@ -1602,16 +1602,35 @@ def getjson(
self, section: str, key: str, fallback=None, **kwargs
) -> dict | list | str | int | float | None:
"""
- Return a config value parsed from a JSON string.
+ Return a config value parsed from a JSON string or JSON file.
- ``fallback`` is *not* JSON parsed but used verbatim when no config value is given.
+ If no direct config value is given for ``key``, attempts to read from a file path
+ specified by ``key + '_file'``.
+
+ ``fallback`` is *not* JSON parsed but used verbatim when no config value or file is given.
"""
try:
data = self.get(section=section, key=key, fallback=None, _extra_stacklevel=1, **kwargs)
except (NoSectionError, NoOptionError):
data = None
if data is None or data == "":
+ try:
Review Comment:
this seems to be unrelated to BigQuery issue?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix BigQueryHook.create_table table_resource type handling (#73091) [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 closed pull request #73155: Fix BigQueryHook.create_table table_resource type handling (#73091)
URL: https://github.com/apache/airflow/pull/73155
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org