Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create StatNameHandlerNotSupportedRule to ease upgrade to Airflow 2.0 #11045

Closed
turbaszek opened this issue Sep 21, 2020 · 6 comments
Closed
Labels
area:upgrade Facilitating migration to a newer version of Airflow good first issue kind:task A task that needs to be completed as part of a larger issue upgrade-check upgrade-check CLI won't fix

Comments

@turbaszek
Copy link
Member

This issue is part of #8765

Rule

Create StatNameHandlerNotSupportedRule which corresponds to

Drop plugin support for stat_name_handler

entry in UPDATING.md. This rule should allow users to check if their current configuration needs any adjusting
before migration to Airflow 2.0.

How to guide

To implement a new rule, create a class that inherits from airflow.upgrade.rules.base_rule.BaseRule.
It will be auto-registered and used by airflow upgrade-check command. The custom rule class has to have title,
description properties and should implement check method which returns a list of error messages in case of
incompatibility.

For example:

class ConnTypeIsNotNullableRule(BaseRule):
title = "Connection.conn_type is not nullable"
description = """\
The `conn_type` column in the `connection` table must contain content. Previously, this rule was \
enforced by application logic, but was not enforced by the database schema.
If you made any modifications to the table directly, make sure you don't have null in the conn_type column.\
"""
@provide_session
def check(self, session=None):
invalid_connections = session.query(Connection).filter(Connection.conn_type.is_(None))
return (
'Connection<id={}", conn_id={}> have empty conn_type field.'.format(conn.id, conn.conn_id)
for conn in invalid_connections
)

Remember to open the PR against v1-10-test branch.

@turbaszek turbaszek added area:upgrade Facilitating migration to a newer version of Airflow kind:feature Feature Requests good first issue labels Sep 21, 2020
@turbaszek turbaszek added this to the Airflow 1.10.13 milestone Sep 21, 2020
@FHoffmannCode
Copy link
Contributor

Hi, I would like to take this task can you assign me? @potiuk @mik-laj @turbaszek

@Dr-Denzy
Copy link
Contributor

Dr-Denzy commented Jan 8, 2021

I will like take up this task.

@turbaszek
Copy link
Member Author

turbaszek commented Jan 8, 2021

There's already PR fort this #11223, I rebased it and will merge once tests pass.

@eladkal eladkal added kind:task A task that needs to be completed as part of a larger issue and removed kind:feature Feature Requests labels Mar 2, 2021
@kaxil kaxil removed this from the Airflow Upgrade Check - 1.3.0 milestone Mar 5, 2021
@eladkal
Copy link
Contributor

eladkal commented May 6, 2021

The PR is stale.
@Dr-Denzy would you like to take this one?

@Dr-Denzy
Copy link
Contributor

Dr-Denzy commented May 6, 2021

The PR is stale.
@Dr-Denzy would you like to take this one?

I am currently neck-deep in some k8s issues but I will be happy to jump in on this once I have more wiggle room.

@eladkal
Copy link
Contributor

eladkal commented Jun 26, 2021

Closing as there will be no more releases of upgrade check

@eladkal eladkal closed this as completed Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:upgrade Facilitating migration to a newer version of Airflow good first issue kind:task A task that needs to be completed as part of a larger issue upgrade-check upgrade-check CLI won't fix
Projects
No open projects
Airflow upgrade check
  
In progress
Development

Successfully merging a pull request may close this issue.

6 participants