Skip to content

Conversation

@arpitrathore
Copy link

closes: #58610

Summary

This PR adds a new provider package apache-airflow-providers-influxdb3 to support InfluxDB 3.x (Core/Enterprise/Cloud Dedicated).
InfluxDB 3.x uses SQL queries and a different API compared to InfluxDB 2.x, which is why a separate provider is needed.

What's Changed

  • New Provider Package: apache-airflow-providers-influxdb3 (version 1.0.0)
  • InfluxDB3Hook: Hook for connecting to InfluxDB 3.x databases with support for:
    • Token-based authentication
    • Database and organization configuration
    • SQL query execution returning pandas DataFrames
    • Writing data points to InfluxDB 3.x
  • InfluxDB3Operator: Operator for executing SQL queries in InfluxDB 3.x databases
  • Connection Type: New influxdb3 connection type with UI form widgets
  • Documentation: Complete documentation including connection setup, operators, and examples
  • Tests: Unit tests for hooks and operators, plus system test examples

Requirements

  • Minimum Airflow version: 2.11.0
  • Main dependency: influxdb3-python>=0.7.0

Testing

  • Unit tests added for InfluxDB3Hook and InfluxDB3Operator
  • System test examples included
  • All tests passing

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Arpit Rathore and others added 6 commits November 28, 2025 15:03
This commit adds a new provider package for InfluxDB 3.x support,
separate from the existing influxdb provider which supports InfluxDB 2.x.

InfluxDB 3.x uses SQL queries and a different API compared to InfluxDB 2.x
which uses Flux queries. This separation allows for:
- Clean API design specific to InfluxDB 3.x
- Independent evolution of both providers
- No breaking changes to existing InfluxDB 2.x users

The provider includes:
- InfluxDB3Hook for connecting to InfluxDB 3.x databases
- InfluxDB3Operator for executing SQL queries
- Comprehensive unit and system tests
- Complete documentation

Closes apache#58610
- Update test_query to properly mock and verify DataFrame return type
- Update test_execute in operator tests to use DataFrame
- Add test for ImportError when influxdb3-python is not available
- Ensure all tests properly validate return types
…w to 2.11.0

- Simplify InfluxDB3Hook.query() to use client's native pandas DataFrame return
- Simplify InfluxDB3Operator to handle DataFrame to JSON conversion
- Update tests to match simplified implementation
- Update minimum Airflow version requirement to 2.11.0 per provider policy
- Update documentation to reflect Airflow 2.11.0+ requirement
- Add docstring explaining how connection parameters are read from form widgets
- Improve error messages to reference connection form fields explicitly
- Add explicit handling for optional org parameter
- Clarify that form widgets automatically populate extras JSON field
…essage

- Add return type annotation to InfluxDB3Operator.execute() method
- Add docstring to execute() method explaining return value
- Fix test error message to match actual error message from hook
- Improve code formatting consistency
@boring-cyborg
Copy link

boring-cyborg bot commented Dec 2, 2025

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

Arpit Rathore and others added 2 commits December 2, 2025 17:12
- Fix CodeQL security issue: use endswith() instead of 'in' for hostname check
- Add proper type annotations for MyPy compliance:
  - self.connection: Connection | None
  - self.extras: dict[str, Any]
  - self.uri: str | None
  - get_client kwargs: dict[str, Any]
- Add None safety check for conn.host in get_uri()
- Add Point availability check in write() method
@arpitrathore
Copy link
Author

Hi All,

This is my first PR to Apache Airflow and I am still learning the contribution process. If anything needs to be corrected or reorganized, please let me know and I will be happy to update it.

Tagging a few maintainers who have recently worked on the InfluxDB provider for visibility.

@bbovenzi @jscheffl @potiuk @kaxil

Thank you for reviewing. I appreciate your help.

@jscheffl
Copy link
Contributor

jscheffl commented Dec 2, 2025

We are currently in the process of discussing/voting the process of accepting new providers [1][2] - there were potential changes discussed there - including incubation period, having a team that is committed (and accountable) to make sure that the provider
submitted to Airflow is going to be maintained in the future - I think it will take that discussion to complete before we consider accepting new providers.

I suggest you respond to the governance thread and comment on those proposals and explain how your proposal fits the proposed governance process, what you see as possible changes or where you see difficulties - that would certainly help in finalizing the discussion and helping with unblocking new provider submissions. Actually I think it's a good idea to have anyone who wants to submit a new provider to actively participate in that discussion - because there are certain things we thing about
"expecting" from those who submit the provider and certain level of commitment it involves, so getting feedback from those who would like to submit a new provider is crucial to get the process better.

[1] https://lists.apache.org/thread/qrv0j4dxp2yg09gds40vh49dhkbrj5q9
[2] https://lists.apache.org/thread/jqjd801g9161dqyv7l2xbsw0v7mp77z1

Arpit Rathore and others added 2 commits December 3, 2025 21:40
…variable

Remove Connection type annotation from self.connection to match pattern
used in other providers. Connection is only imported under TYPE_CHECKING
and MyPy has issues with instance variable type annotations in this case.
Function parameter type annotations work fine with TYPE_CHECKING imports.
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Jan 18, 2026
@potiuk
Copy link
Member

potiuk commented Jan 21, 2026

not stale

@potiuk potiuk removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Jan 21, 2026
@potiuk
Copy link
Member

potiuk commented Jan 21, 2026

Rebasing this PR and fixing the failures is a good start to follow the process of adding it

Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First view on code ad structure looks good. I assume some wiring into dev tooling and GitHub pipelines would be needed to make it complete.

Plus as we are now starting to mature the new policy for providers we need two stewards at least and some committer who is backing the continued work to inter incubation. Is there any sponsor around?

@arpitrathore
Copy link
Author

Thanks for taking a look @jscheffl, appreciate it. Glad to hear the code and structure look good.

Agreed on the remaining wiring needed for dev tooling and GitHub/CI pipelines. I can work on that next.

On the provider policy side, I can commit to being one of the stewards for this provider and maintaining it through incubation and beyond.

I do not have a second steward or a committer sponsor confirmed yet. Do you have a recommendation for a committer who could sponsor this, or should I reach out on the dev mailing list/Slack to find a sponsor and a second steward?

Once that is in place, I can proceed with the remaining integration work and align with the incubation requirements.

@jscheffl
Copy link
Contributor

We are currently finalizing the policy from AIP-95 (https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-95+Provider+lifecycle+update+proposal) in PR #60896 - can you check against here?

I think whilst the PR is open a few days and gets some small wording adjusted, feel free to make this a beta test for the process. As of a discussion should be dropped to devlist. Ipropose to request in the devlist also for support (commiter/stwardship).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add official support for InfluxDB 3 in apache-airflow-providers-influxdb

3 participants