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] Getting started: FlyteScopedUserException #4424

Closed
2 tasks done
mmathys opened this issue Nov 14, 2023 · 7 comments
Closed
2 tasks done

[BUG] Getting started: FlyteScopedUserException #4424

mmathys opened this issue Nov 14, 2023 · 7 comments
Labels
bug Something isn't working flytekit FlyteKit Python related issue needs repro steps This item needs a clear description of how to reproduce the issue and/or screenshots. waiting for reporter Used for when we need input from the bug reporter

Comments

@mmathys
Copy link

mmathys commented Nov 14, 2023

Describe the bug

I ran all the instructions in the getting started guide. However, I encountered the following error when running pyflyte run example.py training_workflow --hyperparameters '{"C": 0.1}'

FlyteScopedUserException: 'target'                                                                                                                                                                                                                                           
Failed with Unknown Exception <class 'KeyError'> Reason: 'Encountered error while executing workflow \'example.training_workflow\':\n  "Error encountered while executing \'training_workflow\':\\n  \'target\'"'
'Encountered error while executing workflow \'example.training_workflow\':\n  "Error encountered while executing \'training_workflow\':\\n  \'target\'"'

I also applied the fsspec hotfix as described in #4414:

pip install fsspec<2023.10.0

Expected behavior

I expected the getting started example to run without errors when running the command:

pyflyte run example.py training_workflow --hyperparameters '{"C": 0.1}'

Additional context to reproduce

Code from getting started for reference
import pandas as pd
from sklearn.datasets import load_wine
from sklearn.linear_model import LogisticRegression

import flytekit.extras.sklearn
from flytekit import task, workflow


@task
def get_data() -> pd.DataFrame:
    """Get the wine dataset."""
    return pd.DataFrame()

@task
def process_data(data: pd.DataFrame) -> pd.DataFrame:
    """Simplify the task from a 3-class to a binary classification problem."""
    return data.assign(target=lambda x: x["target"].where(x["target"] == 0, 1))

@task
def train_model(data: pd.DataFrame, hyperparameters: dict) -> LogisticRegression:
    """Train a model on the wine dataset."""
    features = data.drop("target", axis="columns")
    target = data["target"]
    return LogisticRegression(max_iter=3000, **hyperparameters).fit(features, target)

@workflow
def training_workflow(hyperparameters: dict) -> LogisticRegression:
    """Put all of the steps together into a single workflow."""
    data = get_data()
    processed_data = process_data(data=data)
    return train_model(
        data=processed_data,
        hyperparameters=hyperparameters,
    )

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@mmathys mmathys added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Nov 14, 2023
@davidmirror-ops
Copy link
Contributor

Hi @mmathys

I haven't been able to repro this issue. Would you mind sharing what version of flytekit are you using?

@mmathys
Copy link
Author

mmathys commented Nov 15, 2023

@davidmirror-ops I am using flytekit==1.10.0

@mmathys
Copy link
Author

mmathys commented Nov 15, 2023

I just upgraded and retested this with flytekit==1.10.1, still the same error.

@mmathys
Copy link
Author

mmathys commented Nov 19, 2023

Hi there! Is there any news to this issue?

@davidmirror-ops
Copy link
Contributor

@mmathys what Python version are you running? I'm curious about the 'Target' error.

@eapolinario eapolinario added flytekit FlyteKit Python related issue and removed untriaged This issues has not yet been looked at by the Maintainers labels Nov 30, 2023
@eapolinario
Copy link
Contributor

I'm not able to repro this. @mmathys , can you run pip freeze and also share the python version and architecture you're seeing this on?

@eapolinario eapolinario added needs repro steps This item needs a clear description of how to reproduce the issue and/or screenshots. waiting for reporter Used for when we need input from the bug reporter labels Nov 30, 2023
@mmathys
Copy link
Author

mmathys commented Nov 30, 2023

Hi! We decided to move on to another solution. Therefore I am closing this issue. Thanks for following up.

@mmathys mmathys closed this as completed Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytekit FlyteKit Python related issue needs repro steps This item needs a clear description of how to reproduce the issue and/or screenshots. waiting for reporter Used for when we need input from the bug reporter
Projects
None yet
Development

No branches or pull requests

3 participants