Skip to content

Commit

Permalink
Again
Browse files Browse the repository at this point in the history
  • Loading branch information
romain-intel committed Nov 19, 2024
1 parent f7d8543 commit 603bd56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions metaflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def echo_always(line, **kwargs):
click.secho(ERASE_TO_EOL, **kwargs)


echo = None


def logger(body="", system_msg=False, head="", bad=False, timestamp=True, nl=True):
if timestamp:
if timestamp is True:
Expand Down
9 changes: 5 additions & 4 deletions metaflow/cmd/develop/stub_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,22 +1238,23 @@ def exploit_default(default_value: Any) -> Optional[str]:
buff.write(indentation + deco + "\n")
buff.write(indentation + "def " + name + "(")
kw_only_param = False
has_var_args = False
for i, (par_name, parameter) in enumerate(my_sign.parameters.items()):
annotation = self._exploit_annotation(parameter.annotation)

default = exploit_default(parameter.default)

if kw_only_param and parameter.kind not in (
inspect.Parameter.KEYWORD_ONLY,
inspect.Parameter.VAR_KEYWORD,
):
if kw_only_param and parameter.kind != inspect.Parameter.KEYWORD_ONLY:
raise RuntimeError(
"In function '%s': cannot have a positional parameter after a "
"keyword only parameter" % name
)
has_var_args |= parameter.kind == inspect.Parameter.VAR_KEYWORD

if (
parameter.kind == inspect.Parameter.KEYWORD_ONLY
and not kw_only_param
and not has_var_args
):
kw_only_param = True
buff.write("*, ")
Expand Down

0 comments on commit 603bd56

Please sign in to comment.