Repository navigation
Fix InfluxDB hook methods failing when called before get_conn - #71705
Merged
eladkal merged 1 commit intoAug 20, 2026
Merged
Conversation
Six client-backed methods read self.client directly, so any Dag that called them without first calling get_conn() crashed with an AttributeError. The unit tests assigned the client attribute by hand, which hid the failure from CI. The default port also pointed at Neo4j's Bolt port, making a connection without an explicit port unusable.
Contributor
|
LGTM! |
fat-catTW
approved these changes
Aug 18, 2026
Contributor
|
cc @arpitrathore can you take a look? |
Contributor
|
LGTM! |
eladkal
approved these changes
Aug 20, 2026
Miretpl
pushed a commit
to Miretpl/airflow
that referenced
this pull request
Aug 20, 2026
…71705) Six client-backed methods read self.client directly, so any Dag that called them without first calling get_conn() crashed with an AttributeError. The unit tests assigned the client attribute by hand, which hid the failure from CI. The default port also pointed at Neo4j's Bolt port, making a connection without an explicit port unusable.
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
…71705) Six client-backed methods read self.client directly, so any Dag that called them without first calling get_conn() crashed with an AttributeError. The unit tests assigned the client attribute by hand, which hid the failure from CI. The default port also pointed at Neo4j's Bolt port, making a connection without an explicit port unusable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
InfluxDBHook.write()and the five bucket/organization methods readself.clientdirectly, but that attribute staysNoneuntil something callsget_conn(). Any Dag that calls them on a fresh hook fails withAttributeError: 'NoneType' object has no attribute 'write_api'.They now take the client from
self.get_conn(), which is whatquery()andquery_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 forhttpand 443 forhttps, matchingInfluxDB3Hook.get_uri()in the same provider.create_bucket()accepts aretention_rulesargument and then passed a hardcodedNoneto the client, silently discarding whatever the caller supplied.influxdb_hook.org_name, which has not existed since the constructor moved toself.extras. It also passed an organization name intocreate_bucket()'sorg_idparameter, so it now resolves the name to anID first.
Was generative AI tooling used to co-author this PR?