Skip to content

docs(otelcollector): name the parameter that exists, and drop a branch that does not - #1484

Open
lxcxjxhx wants to merge 1 commit into
AgentOps-AI:mainfrom
lxcxjxhx:docs/template-docstring-args
Open

lxcxjxhx wants to merge 1 commit into
AgentOps-AI:mainfrom
lxcxjxhx:docs/template-docstring-args

Conversation

@lxcxjxhx

Copy link
Copy Markdown

All three functions in this file take output_dir. The docstrings call it output_path, and then promise that "if None, the rendered template is only returned".

Neither half holds:

Claim Reality
parameter is output_path it is output_dir
"the rendered template is only returned" _render_template returns None; the text goes to a file
"If None …" render_base_config does os.path.join(output_dir, "base.yaml"), which raises
>>> os.path.join(None, "base.yaml")
TypeError: expected str, bytes or os.PathLike object, not NoneType

So the documented "optional" behaviour is a crash, not a fallback. The docstrings now say what the functions do.

Verification

  • AST comparison against the previous head with docstrings excluded: identical.
  • python -m py_compile on the module: passes.
  • The TypeError above is run, not inferred.

Note: output_dir: Optional[str] = None is still in the two signatures. I did not change the signatures — the annotation and the body disagree, but that is a code decision, not a docstring one.

…h that does not

All three functions take `output_dir`; the docstrings call it `output_path` and then promise
that "if None, the rendered template is only returned".

Neither half holds:

- the parameter is `output_dir`, and `_render_template` returns `None` — the rendered text is
  written to a file, never returned;
- passing `None` does not fall back to anything. `render_base_config` does
  `os.path.join(output_dir, "base.yaml")`, which raises

      TypeError: expected str, bytes or os.PathLike object, not NoneType

So the documented "optional" behaviour is a crash. The docstrings now describe what the
functions do.

Docstrings only: AST comparison against the previous head is identical once docstrings are
excluded, and the module compiles.

This branch has not been deployed

No deployments
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.

1 participant