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 determine which FROM clause to join from, there are multiple FROMS which can join to this entity. #6977

Closed
ablegao opened this issue Mar 5, 2019 · 1 comment

Comments

@ablegao
Copy link

@ablegao ablegao commented Mar 5, 2019

python 3.6.6
Superset 0.999.0dev and pip install superset=[0.27.0, 0.28.0, 0.28.1, 0.29.0rc6, 0.29.0rc]
sqlalchemy==1.3.0

ERROR:

(pyweb) [root@li1853-91 incubator-superset]# superset db upgrade

  • Tip: There are .env files present. Do "pip install python-dotenv" to use them.
    INFO [alembic.runtime.migration] Context impl SQLiteImpl.
    INFO [alembic.runtime.migration] Will assume transactional DDL.
    INFO [alembic.runtime.migration] Running upgrade bddc498dd179 -> 4451805bbaa1, remove double percents
    Traceback (most recent call last):
    File "/usr/local/pyweb/bin/superset", line 4, in
    import('pkg_resources').run_script('apache-superset==0.999.0.dev0', 'superset')
    File "/usr/local/pyweb/lib64/python3.6/site-packages/pkg_resources/init.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/pkg_resources/init.py", line 1446, in run_script
    exec(code, namespace, namespace)
    File "/usr/local/pyweb/lib/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/EGG-INFO/scripts/superset", line 31, in
    cli()
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 722, in call
    return self.main(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask/cli.py", line 557, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask/cli.py", line 412, in decorator
    return __ctx.invoke(f, *args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask_migrate/cli.py", line 134, in upgrade
    _upgrade(directory, revision, sql, tag, x_arg)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask_migrate/init.py", line 95, in wrapped
    f(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask_migrate/init.py", line 280, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/command.py", line 276, in upgrade
    script.run_env()
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/script/base.py", line 475, in run_env
    util.load_python_file(self.dir, "env.py")
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/util/pyfiles.py", line 90, in load_python_file
    module = load_module_py(module_id, path)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/util/compat.py", line 156, in load_module_py
    spec.loader.exec_module(module)
    File "", line 678, in exec_module
    File "", line 219, in _call_with_frames_removed
    File "/usr/local/pyweb/lib64/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/superset/migrations/env.py", line 116, in
    run_migrations_online()
    File "/usr/local/pyweb/lib64/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/superset/migrations/env.py", line 109, in run_migrations_online
    context.run_migrations()
    File "", line 8, in run_migrations
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/runtime/environment.py", line 839, in run_migrations
    self.get_context().run_migrations(**kw)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/runtime/migration.py", line 361, in run_migrations
    step.migration_fn(**kw)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/superset/migrations/versions/4451805bbaa1_remove_double_percents.py", line 98, in upgrade
    replace('%%', '%')
    File "/usr/local/pyweb/lib64/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/superset/migrations/versions/4451805bbaa1_remove_double_percents.py", line 69, in replace
    .join(Table)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 2189, in join
    from_joinpoint=from_joinpoint,
    File "", line 2, in _join
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/base.py", line 220, in generate
    fn(self, *args[1:], **kw)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 2368, in _join
    left, right, onclause, prop, create_aliases, outerjoin, full
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 2391, in _join_left_to_right
    ) = self._join_determine_implicit_left_side(left, right, onclause)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 2522, in _join_determine_implicit_left_side
    "Can't determine which FROM clause to join "
    sqlalchemy.exc.InvalidRequestError: Can't determine which FROM clause to join from, there are multiple FROMS which can join to this entity. Try adding an explicit ON clause to help resolve the ambiguity.
    (pyweb) [root@li1853-91 incubator-superset]# pip install sqlalchemy==1.3.0
    Collecting sqlalchemy==1.3.0
    Using cached https://files.pythonhosted.org/packages/35/9e/5eb467ed50cdd8e88b808a7e65045020fa12b3b9c2ab51de0f452d269d4d/SQLAlchemy-1.3.0.tar.gz
    Installing collected packages: sqlalchemy
    Found existing installation: SQLAlchemy 1.3.0b3
    Uninstalling SQLAlchemy-1.3.0b3:
    Successfully uninstalled SQLAlchemy-1.3.0b3
    Running setup.py install for sqlalchemy ... done
    Successfully installed sqlalchemy-1.3.0
    (pyweb) [root@li1853-91 incubator-superset]# superset db upgrade
  • Tip: There are .env files present. Do "pip install python-dotenv" to use them.
    INFO [alembic.runtime.migration] Context impl SQLiteImpl.
    INFO [alembic.runtime.migration] Will assume transactional DDL.
    INFO [alembic.runtime.migration] Running upgrade bddc498dd179 -> 4451805bbaa1, remove double percents
    Traceback (most recent call last):
    File "/usr/local/pyweb/bin/superset", line 4, in
    import('pkg_resources').run_script('apache-superset==0.999.0.dev0', 'superset')
    File "/usr/local/pyweb/lib64/python3.6/site-packages/pkg_resources/init.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/pkg_resources/init.py", line 1446, in run_script
    exec(code, namespace, namespace)
    File "/usr/local/pyweb/lib/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/EGG-INFO/scripts/superset", line 31, in
    cli()
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 722, in call
    return self.main(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask/cli.py", line 557, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask/cli.py", line 412, in decorator
    return __ctx.invoke(f, *args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask_migrate/cli.py", line 134, in upgrade
    _upgrade(directory, revision, sql, tag, x_arg)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask_migrate/init.py", line 95, in wrapped
    f(*args, **kwargs)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/flask_migrate/init.py", line 280, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/command.py", line 276, in upgrade
    script.run_env()
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/script/base.py", line 475, in run_env
    util.load_python_file(self.dir, "env.py")
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/util/pyfiles.py", line 90, in load_python_file
    module = load_module_py(module_id, path)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/util/compat.py", line 156, in load_module_py
    spec.loader.exec_module(module)
    File "", line 678, in exec_module
    File "", line 219, in _call_with_frames_removed
    File "/usr/local/pyweb/lib64/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/superset/migrations/env.py", line 116, in
    run_migrations_online()
    File "/usr/local/pyweb/lib64/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/superset/migrations/env.py", line 109, in run_migrations_online
    context.run_migrations()
    File "", line 8, in run_migrations
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/runtime/environment.py", line 839, in run_migrations
    self.get_context().run_migrations(**kw)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/alembic/runtime/migration.py", line 361, in run_migrations
    step.migration_fn(**kw)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/superset/migrations/versions/4451805bbaa1_remove_double_percents.py", line 98, in upgrade
    replace('%%', '%')
    File "/usr/local/pyweb/lib64/python3.6/site-packages/apache_superset-0.999.0.dev0-py3.6.egg/superset/migrations/versions/4451805bbaa1_remove_double_percents.py", line 69, in replace
    .join(Table)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 2234, in join
    from_joinpoint=from_joinpoint,
    File "", line 2, in _join
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/base.py", line 220, in generate
    fn(self, *args[1:], **kw)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 2413, in _join
    left, right, onclause, prop, create_aliases, outerjoin, full
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 2436, in _join_left_to_right
    ) = self._join_determine_implicit_left_side(left, right, onclause)
    File "/usr/local/pyweb/lib64/python3.6/site-packages/sqlalchemy/orm/query.py", line 2567, in _join_determine_implicit_left_side
    "Can't determine which FROM clause to join "
    sqlalchemy.exc.InvalidRequestError: Can't determine which FROM clause to join from, there are multiple FROMS which can join to this entity. Try adding an explicit ON clause to help resolve the ambiguity.
@ablegao

This comment has been minimized.

Copy link
Author

@ablegao ablegao commented Mar 5, 2019

use pip install sqlalchemy==1.2.18

@ablegao ablegao closed this Mar 5, 2019
jitendra-kumawat added a commit to Guavus/incubator-superset that referenced this issue Mar 8, 2019
fixed sqlalchemy version in steup py because of docker  build failure apache#6977

UIC-1096
ankursinghal2005 added a commit to Guavus/incubator-superset that referenced this issue Mar 8, 2019
fixed sqlalchemy version in steup py because of docker  build failure apache#6977

UIC-1096
geekeren added a commit to geekeren/openlmis-ref-distro that referenced this issue Sep 23, 2019
Fixed: the following issues
- superset got error: " import superset Error: cannot import name '_maybe_box_datetimelike'"
- ref: apache/incubator-superset#6977; "Can't determine which FROM clause to join from, there are multiple FROMS which can join to this entity"
sebbrudzinski added a commit to OpenLMIS/openlmis-ref-distro that referenced this issue Oct 15, 2019
* #90 Fix superset starting issues

Fixed: the following issues
- superset got error: " import superset Error: cannot import name '_maybe_box_datetimelike'"
- ref: apache/incubator-superset#6977; "Can't determine which FROM clause to join from, there are multiple FROMS which can join to this entity"

* Fix psycopg2 issue, use binary version 2.8.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.