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] feature_utils unit tests failing mypy #574

Open
lmeyerov opened this issue Jul 4, 2024 · 1 comment
Open

[BUG] feature_utils unit tests failing mypy #574

lmeyerov opened this issue Jul 4, 2024 · 1 comment

Comments

@lmeyerov
Copy link
Contributor

lmeyerov commented Jul 4, 2024

Describe the bug

Regular PR fails on mypy analysis of feature_utils: https://github.com/graphistry/pygraphistry/actions/runs/9800176651/job/27061697437?pr=573

PyGraphistry API client environment

  • Where run: GHA CI
  • Version: 0.33.8 (main)

Additional context

+ mypy --config-file mypy.ini graphistry
graphistry/feature_utils.py:39: error: Cannot assign to a type  [misc]
graphistry/feature_utils.py:39: error: Incompatible types in assignment (expression has type "object", variable has type "Type[SentenceTransformer]")  [assignment]

=>

SentenceTransformer = Any

on

if TYPE_CHECKING:
    MIXIN_BASE = ComputeMixin
    try:
        from sklearn.pipeline import Pipeline
    except:
        Pipeline = Any
    try:
        from sentence_transformers import SentenceTransformer
    except:
        SentenceTransformer = Any
    try:
        from dirty_cat import (
            SuperVectorizer,
            GapEncoder,
            SimilarityEncoder,
        )
    except:
        SuperVectorizer = Any
        GapEncoder = Any
        SimilarityEncoder = Any
    try:
        from sklearn.preprocessing import FunctionTransformer
        from sklearn.base import BaseEstimator, TransformerMixin
    except:
        FunctionTransformer = Any
        BaseEstimator = object
        TransformerMixin = object
else:
    MIXIN_BASE = object
    Pipeline = Any
    SentenceTransformer = Any
    SuperVectorizer = Any
    GapEncoder = Any
    SimilarityEncoder = Any
    FunctionTransformer = Any
    BaseEstimator = Any
    TransformerMixin = Any

@tanmoyio @mj3cheun @silkspace can one of you take?

@dcolinmorgan
Copy link
Contributor

maybe something here ?

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

No branches or pull requests

2 participants