You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/25 11:40:35 UTC

[GitHub] [airflow] ephraimbuddy opened a new pull request #22353: Use Airflow.Base.metadata in FAB models

ephraimbuddy opened a new pull request #22353:
URL: https://github.com/apache/airflow/pull/22353


   Since FAB models are now in airflow, it makes sense to monitor changes
   in them


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#issuecomment-1073980568


   This should go together with #22397 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy closed pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
ephraimbuddy closed pull request #22353:
URL: https://github.com/apache/airflow/pull/22353


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk edited a comment on pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#issuecomment-1074144760


   Yeah. separate PR. That was a mental shortcut and reminder for myself - "remember about it when you implement #22397" - but if you want to implement it in the meantime (as separate PR)- feel free :) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#discussion_r829637799



##########
File path: airflow/migrations/versions/0058_03afc6b6f902_increase_length_of_fab_ab_view_menu_.py
##########
@@ -40,57 +38,23 @@
 
 def upgrade():
     """Apply Increase length of ``Flask-AppBuilder`` ``ab_view_menu.name`` column"""
-    conn = op.get_bind()
-    inspector = inspect(conn)
-    tables = inspector.get_table_names()
-
-    if "ab_view_menu" in tables:
-        if conn.dialect.name == "sqlite":
-            op.execute("PRAGMA foreign_keys=off")
-            op.execute(
-                """
-            CREATE TABLE IF NOT EXISTS ab_view_menu_dg_tmp
-            (
-                id INTEGER NOT NULL PRIMARY KEY,
-                name VARCHAR(250) NOT NULL UNIQUE
-            );

Review comment:
       This migration dropped the unique key constraint on the name for SQLite. I had to do it with batch mode since there's now batch mode support




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#issuecomment-1074144760


   Yeah. separate PR. That was a mental shortcut for myself - "remember about it when you implement #22397" - but if you want to implement it in the meantime (as separate PR)- feel free :) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#issuecomment-1074134431






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#issuecomment-1078763395


   > I have a slight worry about importing `airflow.models` in `fab_security` might cause an import cycle, but from a quick search this seems to be safe.
   
   I think we will be good unless we import anything from `fab_security` into `airflow.models.base`?
   cc: @ashb 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy removed a comment on pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
ephraimbuddy removed a comment on pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#issuecomment-1074134432


   > This should go together with #22397
   
   Should I make a separate PR for it? Looks like it should be on a separate PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#discussion_r835040749



##########
File path: airflow/migrations/versions/0097_5e3ec427fdd3_increase_length_of_email_and_username.py
##########
@@ -80,4 +80,3 @@ def downgrade():
             batch_op.alter_column('username', type_=sa.String(64))
             batch_op.create_unique_constraint(None, ['username'])
             batch_op.alter_column('email', type_=sa.String(64))
-            batch_op.create_unique_constraint(None, ['email'])

Review comment:
       This is not released yet




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #22353: Use Airflow.Base.metadata for FAB models

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#discussion_r829566101



##########
File path: tests/utils/test_db.py
##########
@@ -54,23 +54,6 @@ def test_database_schema_and_sqlalchemy_model_are_in_sync(self):
             # ignore indices created by celery
             lambda t: (t[0] == 'remove_index' and t[1].name == 'task_id'),
             lambda t: (t[0] == 'remove_index' and t[1].name == 'taskset_id'),
-            # Ignore all the fab tables
-            lambda t: (t[0] == 'remove_table' and t[1].name == 'ab_permission'),

Review comment:
       We have to monitor these now and ensure they are in sync

##########
File path: airflow/migrations/versions/0058_03afc6b6f902_increase_length_of_fab_ab_view_menu_.py
##########
@@ -40,57 +38,23 @@
 
 def upgrade():
     """Apply Increase length of ``Flask-AppBuilder`` ``ab_view_menu.name`` column"""
-    conn = op.get_bind()
-    inspector = inspect(conn)
-    tables = inspector.get_table_names()
-
-    if "ab_view_menu" in tables:
-        if conn.dialect.name == "sqlite":
-            op.execute("PRAGMA foreign_keys=off")
-            op.execute(
-                """
-            CREATE TABLE IF NOT EXISTS ab_view_menu_dg_tmp
-            (
-                id INTEGER NOT NULL PRIMARY KEY,
-                name VARCHAR(250) NOT NULL UNIQUE
-            );

Review comment:
       This migration dropped the unique key constraint on the name for SQLite. I had to do it with batch mode since there's now batch mode support




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy commented on a change in pull request #22353: Use Airflow.Base.metadata for FAB models

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on a change in pull request #22353:
URL: https://github.com/apache/airflow/pull/22353#discussion_r829566101



##########
File path: tests/utils/test_db.py
##########
@@ -54,23 +54,6 @@ def test_database_schema_and_sqlalchemy_model_are_in_sync(self):
             # ignore indices created by celery
             lambda t: (t[0] == 'remove_index' and t[1].name == 'task_id'),
             lambda t: (t[0] == 'remove_index' and t[1].name == 'taskset_id'),
-            # Ignore all the fab tables
-            lambda t: (t[0] == 'remove_table' and t[1].name == 'ab_permission'),

Review comment:
       We have to monitor these now and ensure they are in sync




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ephraimbuddy merged pull request #22353: Use Airflow.Base.metadata in FAB models

Posted by GitBox <gi...@apache.org>.
ephraimbuddy merged pull request #22353:
URL: https://github.com/apache/airflow/pull/22353


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org