Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Fixing indent issue with kwargs["extra"]#789

Open
MasonEgger wants to merge 5 commits intomain from
workflow-logger-extra-bug
Open

Fixing indent issue with kwargs["extra"] #789
MasonEgger wants to merge 5 commits intomain from
workflow-logger-extra-bug

Conversation

@MasonEgger
Copy link

@MasonEgger MasonEgger commented Mar 17, 2025

What was changed

Fixing the indent the setting of kwargs["extra"] in the process method.

Why?

When you set workflow.logger.workflow_info_on_extra = False it caused the Workflow to fail with the error

 File "/Users/masonegger/Code/Temporal/edu-102-python-code/venv/lib/python3.13/site-packages/temporalio/worker/_workflow_instance.py", line 391, in activate
 self._run_once(check_conditions=index == 1 or index == 2)
 ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/masonegger/Code/Temporal/edu-102-python-code/venv/lib/python3.13/site-packages/temporalio/worker/_workflow_instance.py", line 1857, in _run_once
 raise self._current_activation_error
 File "/Users/masonegger/Code/Temporal/edu-102-python-code/venv/lib/python3.13/site-packages/temporalio/worker/_workflow_instance.py", line 1875, in _run_top_level_workflow_function
 await coro
 File "/Users/masonegger/Code/Temporal/edu-102-python-code/venv/lib/python3.13/site-packages/temporalio/worker/_workflow_instance.py", line 872, in run_workflow
 result = await self._inbound.execute_workflow(input)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/masonegger/Code/Temporal/edu-102-python-code/venv/lib/python3.13/site-packages/temporalio/worker/_workflow_instance.py", line 2256, in execute_workflow
 return await input.run_fn(*args)
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/Users/masonegger/Code/Temporal/edu-102-python-code/exercises/durable-execution/solution/workflow.py", line 24, in run
 workflow.logger.info(f"TranslationWorkflow invoked with")
 ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/logging/__init__.py", line 1906, in info
 self.log(INFO, msg, *args, **kwargs)
 ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/logging/__init__.py", line 1943, in log
 msg, kwargs = self.process(msg, kwargs)
 ~~~~~~~~~~~~^^^^^^^^^^^^^
 File "/Users/masonegger/Code/Temporal/edu-102-python-code/venv/lib/python3.13/site-packages/temporalio/workflow.py", line 1364, in process
 kwargs["extra"] = {**extra, **(kwargs.get("extra") or {})}
 ^^^^^

@MasonEgger MasonEgger requested a review from a team as a code owner March 17, 2025 22:52
Copy link

CLAassistant commented Mar 17, 2025
edited
Loading

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@dandavison dandavison left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Contributor

This was an error in #664. We should configure linter / type-checker in CI to catch this (and we should ideally have coverage showing that the branch wasn't tested). Pyright catches it (reportPossiblyUnboundVariable, but VSCode must be set to strict for this to be enabled).

Copy link
Contributor

Extended tests so that they'll fail without this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dandavison dandavison dandavison approved these changes

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /