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

[Typing] list_tasks can be made more explicit in return type with @overload #1299

Closed
eddiebergman opened this issue Jan 7, 2024 · 0 comments

Comments

@eddiebergman
Copy link
Collaborator

eddiebergman commented Jan 7, 2024

By using an @overload, on output_type: Literal["dict", "dataframe"] this can be converted used to give the correct type returned.

def list_tasks(
task_type: Optional[TaskType] = None,
offset: Optional[int] = None,
size: Optional[int] = None,
tag: Optional[str] = None,
output_format: str = "dict",
**kwargs,
) -> Union[Dict, pd.DataFrame]:

  • Could be partially done for get_X_and_y, at least for dataframe.
@eddiebergman eddiebergman changed the title [Typing] get_tasks can be made more explicit in return type with @overload [Typing] list_tasks can be made more explicit in return type with @overload Jan 7, 2024
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