Skip to content

Remove unnecessary entries in get_provider_info and update the schema#48849

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:trim_down_provider_info
Apr 8, 2025
Merged

Remove unnecessary entries in get_provider_info and update the schema#48849
potiuk merged 1 commit into
apache:mainfrom
potiuk:trim_down_provider_info

Conversation

@potiuk

@potiuk potiuk commented Apr 6, 2025

Copy link
Copy Markdown
Member

The "get_provider_info" for current providers contains a lot of garbage that is only useful for provider.yaml and it has never been even added to the runtime schema for provider_info. On the other hand we have a number of properties that are useful to be exposed and they were missing in the schema.

Other by not being "formalized" cleaning those entries should have no side effects and no newsfragment is needed.:

  • the existing entries (versions, dependencies, optional-dependencies, reproducibility epoch) have never been in the schema so their presence is not guaranteed nor expected.

  • the correct entries added to provider_schema are specified as optional, so there is no impact on existing providers and the current providers will be properly validated by Providers Manager.

Added entries:

  • integrations
  • operators
  • senors
  • hooks
  • asset-uris
  • dataset-uris

Removed entries:

  • state
  • source-date-epoch
  • versions
  • dependenencies
  • optional-dependencies
  • devel-dependencies

This change will also make it simpler to modify dependnecies without modifying any generated code - this is not needed any more and it will allow dependabot to effectively update our providers pyproject.tomls.


^ 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.

@potiuk

potiuk commented Apr 6, 2025

Copy link
Copy Markdown
Member Author

@ashb - > we discussed it the other day, that one should nicely clean-up the provider info schema and data kept in the repo and it should also make the dependency changes much more streamlined (no pre-commits nor release-time updates needed.

@potiuk
potiuk force-pushed the trim_down_provider_info branch from 8e7a411 to b88e5fc Compare April 6, 2025 15:26
@potiuk

potiuk commented Apr 6, 2025

Copy link
Copy Markdown
Member Author

New contender:

Screenshot 2025-04-06 at 17 42 21

@jscheffl

jscheffl commented Apr 6, 2025

Copy link
Copy Markdown
Contributor

New contender:

Does it count on generated code? :-D

@potiuk
potiuk force-pushed the trim_down_provider_info branch from b88e5fc to 85ce5f8 Compare April 6, 2025 16:01
@potiuk

potiuk commented Apr 6, 2025

Copy link
Copy Markdown
Member Author

Does it count on generated code? :-D

Damn.. You got me... I tried to cheat.

@potiuk
potiuk force-pushed the trim_down_provider_info branch from 85ce5f8 to f61ac25 Compare April 7, 2025 09:13
@potiuk

potiuk commented Apr 7, 2025

Copy link
Copy Markdown
Member Author

Apparently "dependencies" were used in our tests (for good reason - before we switched to separate distributions per package Provider's manager "dependencies" was the only reliable source of the information. Switched to importlib instead (which with separate distributions should now work in both editable and standard installation)

@ashb ashb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think there's more that we could remove too, but love to see this

@potiuk
potiuk force-pushed the trim_down_provider_info branch from f61ac25 to 992e763 Compare April 7, 2025 10:13
@potiuk

potiuk commented Apr 7, 2025

Copy link
Copy Markdown
Member Author

I think there's more that we could remove too, but love to see this

BTW. This is really lack of automation and tests - it used to work like that, we did have filtering in place a long time ago, but it has been lost at one of the changes and refactorings - so really the versions, dependencies - that are discoverable via standard packaging now - when we moved to separate distributions - were there only accidentally (and also conveniently there were the only easy way to discover those when providers were not real distributions, so they were somewhat useful in development environment of airflow - like the case with checking min-airflow-vresion in our tests).

But - this is another side effect of having separate distributions for provider - this is no longer needed.

But as mentioned in the other comment - operators, hooks etc. being exposed there is quite deliberate - a way to communicate to anyone who would like to build somethign on top of airflow to see what capbilities are available in the system, which hooks, operators, transfers etc. are there. This can allow people to build - for example - UI where they can select available Operators to build DAGs in UI (for example) - and likely many other things we don't even know.

@potiuk
potiuk force-pushed the trim_down_provider_info branch from 992e763 to 3585c80 Compare April 7, 2025 12:37
@potiuk
potiuk force-pushed the trim_down_provider_info branch from 3585c80 to 33eda9d Compare April 7, 2025 13:43

@o-nikolas o-nikolas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Love the change, just some minor doc nits

Comment thread airflow-core/src/airflow/provider_info.schema.json
Comment thread airflow-core/src/airflow/provider_info.schema.json Outdated
Comment thread airflow-core/src/airflow/provider_info.schema.json Outdated
Comment thread airflow-core/src/airflow/provider_info.schema.json Outdated
@potiuk
potiuk force-pushed the trim_down_provider_info branch from 33eda9d to 1aadadb Compare April 8, 2025 10:29
The "get_provider_info" for current providers contains a lot of garbage
that is only useful for provider.yaml and it has never been even added
to the runtime schema for provider_info. On the other hand we have a
number of properties that are useful to be exposed and they were
missing in the schema.

Other by not being "formalized" cleaning those entries should have no
side effects and no newsfragment is needed.:

* the existing entries (versions, dependencies, optional-dependencies,
  reproducibility epoch) have never been in the schema so their
  presence is not guaranteed nor expected.

* the correct entries added to provider_schema are specified as
  optional, so there is no impact on existing providers and the current
  providers will be properly validated by Providers Manager.

Added entries:

  * integrations
  * operators
  * senors
  * hooks
  * asset-uris
  * dataset-uris
  * dialects

Removed entries:
  * state
  * source-date-epoch
  * versions
  * dependenencies
  * optional-dependencies
  * devel-dependencies

This change will also make it simpler to modify dependnecies
without modifying any generated code - this is not needed any
more and it will allow dependabot to effectively update our
providers pyproject.tomls.
@potiuk
potiuk force-pushed the trim_down_provider_info branch from 1aadadb to 3f2b82e Compare April 8, 2025 11:48
@potiuk
potiuk merged commit 7b2ec33 into apache:main Apr 8, 2025
@potiuk
potiuk deleted the trim_down_provider_info branch April 8, 2025 12:33
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.

7 participants