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

Can't migrate database from 0.15.4 to 0.17.0 using Python 3 #2343

Closed
3 tasks done
rsxm opened this issue Mar 6, 2017 · 3 comments
Closed
3 tasks done

Can't migrate database from 0.15.4 to 0.17.0 using Python 3 #2343

rsxm opened this issue Mar 6, 2017 · 3 comments

Comments

@rsxm
Copy link
Contributor

rsxm commented Mar 6, 2017

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

Migrating from 0.15.4 to 0.17.0 using MySQL database backend and Python 3.5.

Expected results

Succesfull migration.

Actual results

INFO  [alembic.runtime.migration] Running upgrade db0c65b146bd -> a99f2f7c195a, rewriting url from shortner with new format
Traceback (most recent call last):
  File "/Users/canary/anaconda3/envs/super0.17.0/bin/superset", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/Users/canary/Development/supersource/superset/bin/superset", line 14, in <module>
    manager.run()
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/flask_script/__init__.py", line 412, in run
    result = self.handle(sys.argv[0], sys.argv[1:])
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/flask_script/__init__.py", line 383, in handle
    res = handle(*args, **config)
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/flask_script/commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/flask_migrate/__init__.py", line 200, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/alembic/command.py", line 254, in upgrade
    script.run_env()
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/alembic/script/base.py", line 416, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
    module = load_module_py(module_id, path)
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/alembic/util/compat.py", line 64, in load_module_py
    module_id, path).load_module(module_id)
  File "<frozen importlib._bootstrap_external>", line 396, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 817, in load_module
  File "<frozen importlib._bootstrap_external>", line 676, in load_module
  File "<frozen importlib._bootstrap>", line 268, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/Users/canary/Development/supersource/superset/migrations/env.py", line 100, in <module>
    run_migrations_online()
  File "/Users/canary/Development/supersource/superset/migrations/env.py", line 93, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/alembic/runtime/environment.py", line 817, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/Users/canary/anaconda3/envs/super0.17.0/lib/python3.5/site-packages/alembic/runtime/migration.py", line 323, in run_migrations
    step.migration_fn(**kw)
  File "/Users/canary/Development/supersource/superset/migrations/versions/a99f2f7c195a_rewriting_url_from_shortner_with_new_.py", line 62, in upgrade
    d = cast_form_data(d)
  File "/Users/canary/Development/supersource/superset/legacy.py", line 77, in cast_form_data
    for k in d.keys():
RuntimeError: dictionary changed size during iteration

Steps to reproduce

  1. create Python 3 virtualenv
  2. pip install superset==0.15.4
  3. initialise the demo database with a MySQL backend, and add new slices with filters.
  4. pip install -U superset==0.17.0
  5. superset db upgrade
@rsxm
Copy link
Contributor Author

rsxm commented Mar 6, 2017

See #2342 for fix.

@rsxm
Copy link
Contributor Author

rsxm commented Mar 6, 2017

This Python 2/3 compatibility bug affects two migrations:

  • a99f2f7c195a_rewriting_url_from_shortner_with_new_.py
  • db0c65b146bd_update_slice_model_json.py

As well as the get_form_data inner function of the approve view.

@mistercrunch
Copy link
Member

will be fixed in 1.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants