-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Summary
Upgrading sema4ai-actions from 1.4.1 to 1.4.2 in package.yaml causes the action server to fail to start during action collection. The failure originates in docstring parsing/linting: the environment raises an ImportError when docstring_parser.common is expected to expose DocstringYields but does not.
This does not occur with sema4ai-actions=1.4.1 (downgrading to 1.4.1 is an immediate workaround).
Reproduction (minimal)
- In
package.yamlset:
pypi:
- sema4ai-actions=1.4.2
# ... other deps- Run the action server from the repo root:
action-server startObserved behavior / error
The server fails during action import/collection with a traceback similar to:
ImportError: cannot import name 'DocstringYields' from 'docstring_parser.common' (/opt/.../site-packages/docstring_parser/common.py)
...
RuntimeError: It was not possible to list the actions.
...
Error when importing module 'src.linkedin.linkedin-actions' at location '.../src/linkedin/linkedin-actions.py'
Key excerpt from the log we observed inside our environment:
Error calling: <function _ActionsArgDispatcher._register_lint.<locals>.on_func_found at 0x...>.
Traceback (most recent call last):
File "/opt/.../site-packages/sema4ai/actions/_callback.py", line 48, in __call__
c(*args, **kwargs)
File "/opt/.../site-packages/sema4ai/actions/_args_dispatcher.py", line 281, in on_func_found
errors = list(
^^^^^
File "/opt/.../site-packages/sema4ai/actions/_args_dispatcher.py", line 283, in <genexpr>
for x in _lint_action.iter_lint_errors(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/.../site-packages/sema4ai/actions/_lint_action.py", line 435, in iter_lint_errors
yield from _check_docstring_contents(pm, node, docstring, kind)
File "/opt/.../site-packages/sema4ai/actions/_lint_action.py", line 274, in _check_docstring_contents
import docstring_parser
File "/opt/.../site-packages/docstring_parser/__init__.py", line 14, in <module>
from .parser import compose, parse, parse_from_object
File "/opt/.../site-packages/docstring_parser/parser.py", line 6, in <module>
from docstring_parser import epydoc, google, numpydoc, rest
File "/opt/.../site-packages/docstring_parser/numpydoc.py", line 12, in <module>
from .common import (
ImportError: cannot import name 'DocstringYields' from 'docstring_parser.common' (/opt/.../site-packages/docstring_parser/common.py)
Why we think this is a problem with the release
- The issue only appears when using
sema4ai-actions=1.4.2and not with1.4.1. - The error points to
docstring_parserinternals; likely either a transitive dependency version change, or a change insema4ai-actionsthat expects a newerdocstring_parserAPI than what is present in the environment. - The action package import path fails while running the docstring lint step inside your action-collection flow, indicating a docstring parsing incompatibility.
Immediate workaround
- Pin
sema4ai-actions=1.4.1inpackage.yaml. That restores action-server startup in our environment.
Suggested fixes for maintainers
-
Audit the
sema4ai-actions1.4.2 dependency pins (direct or transitive) fordocstring_parserand ensure it pins a version that exposesDocstringYieldsor adapt the docstring lint code to work with the currently installeddocstring_parserversions. -
Consider adding a try/except fallback in the docstring linting code to gracefully skip/ignore the yields-related checks when
DocstringYieldsis unavailable (and log a clear message), rather than raising ImportError and preventing action loading. -
Add a minimal reproducible test or CI job that runs action collection against a repo with several typical action docstrings; this would detect breakages caused by docstring_parser API changes earlier.
Information from our environment (for context)
- Repo: linkedin-easy-apply
- package.yaml (relevant lines):
pypi:
- sema4ai-actions=1.4.2 # triggers the error
- robocorp-browser=2.3.5
- python-dotenv=1.1.1
- beautifulsoup4=4.13.5
- pandas=2.3.2
- mindsdb_sdk=3.4.6
- SQLAlchemy=2.0.43
- psycopg2-binary=2.9.10- Python: 3.12.x (the action-server runtime used
python3.12in our setup) - Observed behavior on
action-server start(command prints earlier stacktrace and aborts)
Request
Could you please:
- Investigate if
sema4ai-actions1.4.2 introduced a changed dependency or internal usage ofdocstring_parserthat requiresDocstringYields? If so, pin a compatibledocstring_parserversion or add a fallback. - If you prefer, I can open a PR that clamps the
docstring_parserversion or makes the lint code resilient — tell me which approach you'd prefer.
Thanks — this is blocking action server startup for users who build with sema4ai-actions 1.4.2; downgrading to 1.4.1 is an immediate workaround.
FWIW not sure if this due to me being on action-server v2.14.1binary.