jayamanikharyono opened a new pull request, #71705:
URL: https://github.com/apache/airflow/pull/71705
`InfluxDBHook.write()` and the five bucket/organization methods read
`self.client` directly, but that attribute stays `None` until something calls
`get_conn()`. Any Dag that calls them on a fresh hook fails with
`AttributeError: 'NoneType' object has no attribute 'write_api'`.
They now take the client from `self.get_conn()`, which is what `query()` and
`query_to_df()` in the same class have always done. `get_conn()` already
returns a cached client, so this opens no additional connections.
Three further defects in the same hook are fixed alongside it:
- `get_uri()` fell back to port 7687 — Neo4j's Bolt port — when the
connection carried no explicit port, so a connection created without one
pointed at an unreachable address. It now defaults to 8086 for `http` and 443
for `https`, matching `InfluxDB3Hook.get_uri()` in the same provider.
- `create_bucket()` accepts a `retention_rules` argument and then passed a
hardcoded `None` to the client, silently discarding whatever the caller
supplied.
- The system Dag reads `influxdb_hook.org_name`, which has not existed since
the constructor moved to `self.extras`. It also passed an organization *name*
into `create_bucket()`'s `org_id` parameter, so it now resolves the name to an
ID first.
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
<!--
Thank you for contributing!
Please provide above a brief description of the changes made in this pull
request.
Write a good git commit message following this guide:
https://chris.beams.io/posts/git-commit/
Please make sure that your code changes are covered with tests.
And in case of new features or big changes remember to adjust the
documentation.
For user-facing UI changes, please attach before/after screenshots (or a
short
screen recording) so reviewers can assess the visual impact.
Feel free to ping (in general) for the review if you do not see reaction for
a few days
(72 Hours is the minimum reaction time you can expect from volunteers) - we
sometimes miss notifications.
In case of an existing issue, reference it using one of the following:
* closes: #ISSUE
* related: #ISSUE
-->
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR,
please
change below checkbox to `[X]` followed by the name of the tool, uncomment
the "Generated-by".
-->
- [ ] Yes (please specify the tool below)
--
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]