Following the question of the user here:
https://apache-airflow.slack.com/archives/CCQ7EGB1P/p1746442613931879?thread_ts=1746430604.330269&cid=CCQ7EGB1P

The user asked which package they can install to be able to do "from
airflow.sdk import Variable". Turns out they are on Airflow 2.

I think the user got quite confused about task.sdk and "from airflow.sdk"
because this is what they **might** see in our docs without realising it's
for Airflow 3 rather than Airflow 2.

I wonder how we should communicate stuff now in the transition period in
our docs and what we should tell our users. Should we tell them to use:

1. from airflow.models Import Variables
or
2.  from airflow.sdk import Variables

The first one allows migration from Airflow 2. And no-one will switch to
`from airlfow.sdk` before they migrate unless we will make task.sdk
possible to be installed in Airflow 2 (it can't be currently).

The bad thing is that even Airflow 3 docs have a mixture of those. There
are many places where we still use "from airflow.models" and a number of
places where we already say "from airflow.sdk" and that can be - I think -
terribly confusing for users who are still using Airflow 2 (it will work
both ways for Airflow 3 of course, so people are likely to end up with
mixture of those as well - depending from where they are copy&pasting stuff.

Few questions:

1) Do we care about consistency (especially now)?

2) If we do - do we suggest users to make bulk replacement of "from
airflow.models" from `from airflow.sdk` after they migrate? Otherwise the
result will be - inevitably - a mixture of those.

3) Or maybe we should come up with a way to install something (or even have
it in airflow 2.11) to be able to switch to `from airflow.sdk` in Airflow
2.

4) If not 3 (or even independently from 3) - should we have some way in
airflow 3 docs to indicate that this is Airflow 3 syntax-only and that they
should use "from airflow.models" in Airflow 2 to avoid similar confusion as
the slack user had?

Were there any thoughts and discussion about it before? Maybe I missed it?

J.

Reply via email to