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

[BUG] Error: Too few parameters for <class 'triad.utils.pandas_like.PandasLikeUtils'> when trying to import fugue #124

Closed
DManowitz opened this issue Jan 19, 2024 · 8 comments

Comments

@DManowitz
Copy link

Minimal Code To Reproduce

import fugue

Describe the bug
Above code results in the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\...\lib\site-packages\fugue\__init__.py", line 17, in <module>
    from fugue.execution.execution_engine import ExecutionEngine, SQLEngine
  File "C:\...\lib\site-packages\fugue\execution\__init__.py", line 3, in <module>
    from fugue.execution.factory import (
  File "C:\...\lib\site-packages\fugue\execution\factory.py", line 4, in <module>
    from fugue.execution.native_execution_engine import NativeExecutionEngine
  File "C:\...\lib\site-packages\fugue\execution\native_execution_engine.py", line 34, in <module>
    from qpd_pandas import run_sql_on_pandas
  File "C:\...\lib\site-packages\qpd_pandas\__init__.py", line 3, in <module>
    from qpd_pandas.engine import QPDPandasEngine, run_sql_on_pandas
  File "C:\...\lib\site-packages\qpd_pandas\engine.py", line 6, in <module>
    from qpd import PandasLikeUtils, QPDEngine, run_sql
  File "C:\...\lib\site-packages\qpd\__init__.py", line 5, in <module>
    from qpd.pandas_like import PandasLikeUtils
  File "C:\...\lib\site-packages\qpd\pandas_like.py", line 23, in <module>
    class PandasLikeUtils(PandasLikeUtilsBase[DfT], Generic[DfT, ColT]):
  File "C:\...\lib\typing.py", line 261, in inner
    return func(*args, **kwds)
  File "C:\...\lib\typing.py", line 897, in __class_getitem__
    _check_generic(cls, params)
  File "C:\...\lib\site-packages\typing_extensions.py", line 166, in _check_generic
    raise TypeError(f"Too {'many' if alen > elen else 'few'} parameters for {cls};"
TypeError: Too few parameters for <class 'triad.utils.pandas_like.PandasLikeUtils'>; actual 1, expected 2

Expected behavior
No exception

Environment (please complete the following information):

  • Backend: pandas 1.5.3/dask 2022.12.1/ray 2.6.3
  • Backend version: fugue 0.6.6/qpd 0.2.7/triad 0.9.3
  • Python version: 3.8
  • OS: Windows 10
@kvnkho
Copy link
Collaborator

kvnkho commented Jan 19, 2024

Your fugue and triad versions look mismatched (and the Fugue version is a bit old). Could you upgrade the Fugue package?

@DManowitz
Copy link
Author

Unfortunately, at the moment, I cannot upgrade fugue because I have another package installed which requires antlr[4]-python[3]-runtime to be 4.9.3. I have noticed that I don't have this issue with triad 0.8.9 and the same fugue and qpd versions, so I suppose I'll downgrade triad for now, but you might want to add some additional checks to prevent this.

@kvnkho
Copy link
Collaborator

kvnkho commented Jan 19, 2024

Ah I understand. I am just curious, what is the other library that has an ANTLR dependency?

We added checks around the fugue 0.8.x. But unfortunately, we can't really go back to fugue 0.6.x and add checks for triad as that's already published. It's also fugue that imports triad so we can't add it on the triad side.

Will wait for @goodwanghan , but I am not sure there's more we can do other than advise you to pin triad to a lower version, which it seems like you did already.

@DManowitz
Copy link
Author

I understand that you can't add checks to a package that is already published.

The other library that currently has a dependency on ANTLR is omegaconf. I and a few others have reported the issue of using an older version of ANTLR. They appear to be in the process of upgrading the version they are using and also vendoring it so as to eliminate any dependency on the version of the library installed elsewhere. I'm currently using Windows, but I think it is even more of a problem on Linux.

@goodwanghan
Copy link
Collaborator

@DManowitz if you don't really need the Fugue SQL part, actually we will release Fugue 0.9.0 within two weeks, and it will remove the hard dependency on antlr.

@DManowitz
Copy link
Author

@goodwanghan, I'll consider that

@goodwanghan
Copy link
Collaborator

@DManowitz actually Fugue 0.9.0.dev3 is already available, you can give a try.

@goodwanghan
Copy link
Collaborator

Fugue 0.9.0 is released, this problem is resolved

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

3 participants