Skip to content

[batch] re-allow sending kwargs to python jobs - #13505

Merged
danking merged 7 commits into
hail-is:mainfrom
danking:fix-kwargs-in-python-jobs
Sep 1, 2023
Merged

danking merged 7 commits into
hail-is:mainfrom
danking:fix-kwargs-in-python-jobs

Conversation

@danking

@danking danking commented Aug 25, 2023

Copy link
Copy Markdown
Contributor

CHANGELOG: Fix bug introduced in 0.2.117 by commit c9de81108 which prevented the passing of keyword arguments to Python jobs. This manifested as "ValueError: too many values to unpack".

We also weren't preserving tuples. They become lists. I fixed that too. I also added some types and avoided an is instance by encoding the necessary knowledge.

CHANGELOG: Fix bug introduced in 0.2.117 by commit `c9de81108` which prevented the passing of keyword arguments to Python jobs. This manifested as "ValueError: too many values to unpack".
Comment thread hail/python/hailtop/batch/job.py Outdated
return True


UnpreparedArg = '_resource.ResourceType' | List['UnpreparedArg'] | Tuple['UnpreparedArg', ...] | Dict[str, 'UnpreparedArg'] | Any

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have to wait until 3.10 for this unfortunately.

@danking
danking force-pushed the fix-kwargs-in-python-jobs branch from 1cb6323 to f5755b8 Compare August 28, 2023 16:08
Comment thread hail/python/hailtop/batch/resource.py Outdated
return self._uid # pylint: disable=no-member


ResourceType = PythonResult | ResourceFile | ResourceGroup

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still have pipes here. I didn't mean to get rid of the types altogether though, just replace the pipes with a Union

@danking

danking commented Aug 31, 2023

Copy link
Copy Markdown
Contributor Author

Ah, my bad, I thought you mean the recursive types with strings. I didn't realize the pipes were new. That's what I get for not clicking links.

This reverts commit 19807da.
@danking danking mentioned this pull request Aug 31, 2023
@danking
danking dismissed daniel-goldstein’s stale review August 31, 2023 22:25

merge main, actually address comments, ensure pyright is satisfied

@@ -12,15 +12,17 @@ def to_dict(self):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't entirely understand why pyright runs on everything but it does and it dislikes the formatting of this file.

from hailtop.aiocloud.aiogoogle import get_gcs_requester_pays_configuration
from hailtop.aiocloud.aiogoogle.user_config import get_spark_conf_gcs_requester_pays_configuration, spark_conf_path
from hailtop.config.user_config import ConfigVariable, configuration_of
from hailtop.config import ConfigVariable, configuration_of

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyright also disliked this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and it's right: ConfigVariable is not part of user_config.py

@danking
danking merged commit a22168b into hail-is:main Sep 1, 2023
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

Successfully merging this pull request may close these issues.

2 participants