Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from alembic import context

from airflow import models, settings
from airflow.models.serialized_dag import SerializedDagModel # noqa
from airflow.models.serialized_dag import SerializedDagModel # pylint: disable=unused-import # noqa

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@potiuk Do you remember if we need this import there?

I remember you were moving the imports for the migrations to work, so I am not sure

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.

It was not here (it was where reset method was) but I think for migrations it's also needed - in order to generate migration diffs for all the model objects.

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.

Possibly we even need to add more here (from airflow.utils.db). Possibly one place where we import one modes?:

from airflow.models import (  # noqa: F401 # pylint: disable=unused-import
    DAG, XCOM_RETURN_KEY, BaseOperator, BaseOperatorLink, Connection, DagBag, DagModel, DagPickle, DagRun,
    DagTag, Log, Pool, SkipMixin, SlaMiss, TaskFail, TaskInstance, TaskReschedule, Variable, XCom,
)
# We need to add this model manually to get reset working well
# noinspection PyUnresolvedReferences
from airflow.models.serialized_dag import SerializedDagModel  # noqa: F401  # pylint: disable=unused-import

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it might be ok, we only needed that in db.resetdb. Ran it locally, didn't error

#7381
https://github.com/apache/airflow/pull/6938/files

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

WDYT @potiuk ?

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.

LGTM!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In that case, can you approve it :D



def include_object(_, name, type_, *args):
Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ ignored-classes=optparse.Values,thread._local,_thread._local,sqlalchemy.orm.scop
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=alembic.op
ignored-modules=alembic.op,alembic.context

# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
Expand Down
1 change: 0 additions & 1 deletion scripts/ci/pylint_todo.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
./airflow/configuration.py
./airflow/logging_config.py
./airflow/macros/hive.py
./airflow/migrations/env.py
./airflow/models/crypto.py
./airflow/models/dag.py
./airflow/models/dagbag.py
Expand Down