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

Fixes #589: validation logic to capture reserved keywords #830

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions metaflow/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,21 @@ def __init__(self, name, **kwargs):
self.kwargs = kwargs
# TODO: check that the type is one of the supported types
param_type = self.kwargs["type"] = self._get_type(kwargs)

if self.name == "params":
reserved_params = [
"params",
"with",
"max-num-splits",
"max-workers",
"tag",
"run-id-file",
"namespace",
]

if self.name in reserved_params:
raise MetaflowException(
"Parameter name 'params' is a reserved "
"Parameter name '%s' is a reserved "
"word. Please use a different "
"name for your parameter."
"name for your parameter." % (name)
)

# make sure the user is not trying to pass a function in one of the
Expand Down