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

Limit flask-session to <0.6 #36895

Merged
merged 1 commit into from
Jan 19, 2024
Merged

Conversation

Taragolis
Copy link
Contributor

New version of Flask-Session breaks our AirflowDatabaseSessionInterface by add new arguments into the constructor sid_length, sequence, schema and bind_key and make all arguments are mandatory include previously optional use_signer and permanent

Test OpenAPI client

Run airflow db init
/home/runner/actions-runner/_work/airflow/airflow/airflow/cli/commands/db_command.py:47 DeprecationWarning: `db init` is deprecated.  Use `db migrate` instead to migrate the db and/or airflow connections create-default-connections to create the default connections
DB: sqlite:////home/runner/airflow/airflow.db
[2024-01-19T09:50:[35](https://github.com/apache/airflow/actions/runs/7582079179/job/20650960654?pr=36893#step:12:36).350+0000] {migration.py:216} INFO - Context impl SQLiteImpl.
[2024-01-19T09:50:35.352+0000] {migration.py:219} INFO - Will assume non-transactional DDL.
Traceback (most recent call last):
  File "/home/runner/actions-runner/_work/_tool/Python/3.8.18/x64/bin/airflow", line 8, in <module>
    sys.exit(main())
  File "/home/runner/actions-runner/_work/airflow/airflow/airflow/__main__.py", line 57, in main
    args.func(args)
  File "/home/runner/actions-runner/_work/airflow/airflow/airflow/cli/cli_config.py", line 49, in command
    return func(*args, **kwargs)
  File "/home/runner/actions-runner/_work/airflow/airflow/airflow/utils/providers_configuration_loader.py", line 55, in wrapped_function
    return func(*args, **kwargs)
  File "/home/runner/actions-runner/_work/airflow/airflow/airflow/cli/commands/db_command.py", line 53, in initdb
    db.initdb()
  File "/home/runner/actions-runner/_work/airflow/airflow/airflow/utils/session.py", line 79, in wrapper
    return func(*args, session=session, **kwargs)
  File "/home/runner/actions-runner/_work/airflow/airflow/airflow/utils/db.py", line 732, in initdb
    _create_db_from_orm(session=session)
  File "/home/runner/actions-runner/_work/airflow/airflow/airflow/utils/db.py", line 717, in _create_db_from_orm
    _create_flask_session_tbl(engine.url)
  File "/home/runner/actions-runner/_work/airflow/airflow/airflow/utils/db.py", line 710, in _create_flask_session_tbl
    db = _get_flask_db(sql_database_uri)
  File "/home/runner/actions-runner/_work/airflow/airflow/airflow/utils/db.py", line 699, in _get_flask_db
    AirflowDatabaseSessionInterface(app=flask_app, db=db, table="session", key_prefix="")
TypeError: __init__() missing 6 required positional arguments: 'sequence', 'schema', 'bind_key', 'use_signer', 'permanent', and 'sid_length'
Error: Process completed with exit code 1.

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

@Taragolis Taragolis added this to the Airflow 2.8.2 milestone Jan 19, 2024
@Taragolis Taragolis merged commit 0190ba3 into apache:main Jan 19, 2024
80 checks passed
@Taragolis Taragolis deleted the limit-flask-session branch January 19, 2024 11:58
@potiuk
Copy link
Member

potiuk commented Jan 19, 2024

I think we should also make an issue to fix it for the (near) future. Created an issue for that #36897

@ldacey
Copy link
Contributor

ldacey commented Jan 21, 2024

Ahh thanks for this - pinning flask-session fixed the issue for me as well when I upgraded to 2.8.1 earlier. Never upgrade on a weekend right before bed...

potiuk pushed a commit that referenced this pull request Feb 7, 2024
(cherry picked from commit 0190ba3)
@Taragolis Taragolis mentioned this pull request Feb 13, 2024
2 tasks
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Feb 19, 2024
ephraimbuddy pushed a commit that referenced this pull request Feb 22, 2024
(cherry picked from commit 0190ba3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants