-
Notifications
You must be signed in to change notification settings - Fork 6
Bug fix: AttributeError: 'coroutine' object has no attribute 'strip' #18
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an AttributeError where code was attempting to call .strip() on coroutine objects returned by click.prompt(). The fix makes click.prompt() calls async by adding await, ensuring the method returns a string instead of a coroutine object.
Key changes:
- Updated
click.prompt()calls inConfigManagerto be awaited properly - Converted test mock functions from synchronous to asynchronous to match the updated production code
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/workato_platform/cli/utils/config/manager.py | Added await to five click.prompt() calls to properly handle async returns |
| tests/unit/config/test_manager.py | Converted mock prompt functions from sync to async and replaced inline lambdas with named async functions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Breaking change in asyncclick 8.3.0 made click.prompt async, causing inconsistent behavior across Python versions: - Python 3.13 + asyncclick 8.2.2: click.prompt synchronous, await caused TypeError - Python 3.11 + asyncclick 8.3.0: click.prompt async, missing await caused AttributeError Changes made: - Made ProfileManager.select_region_interactive() async and added await to click.prompt - Made ConnectorManager.prompt_for_oauth_parameters() async and added await to click.prompt calls - Updated connections.create() to await prompt_for_oauth_parameters() - Updated all test functions to be async with @pytest.mark.asyncio decorators - Changed test mocks from Mock to AsyncMock for async functions - Fixed test monkeypatch to return coroutines for async click.prompt Affected commands: - workato init (region selection with custom URL) - workato connections create (OAuth parameter prompting) Files modified: - src/workato_platform/cli/utils/config/profiles.py - src/workato_platform/cli/commands/connectors/connector_manager.py - src/workato_platform/cli/commands/connections.py - tests/unit/config/test_profiles.py - tests/unit/commands/connectors/test_connector_manager.py - tests/unit/commands/connections/test_commands.py - tests/unit/commands/test_connections.py
- Fix line length violations in test function signatures - Add type annotations to async mock function - Auto-format code with ruff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
uv.lock
Outdated
| @@ -1,5 +1,5 @@ | |||
| version = 1 | |||
| revision = 3 | |||
| revision = 2 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like your are using an older version of uv to generate this lock file? not sure the implications of going back to 2, can you generate this with a newer version of uv?
.workato-ignore
Outdated
| @@ -0,0 +1,67 @@ | |||
| # Workato CLI ignore patterns | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this file from the PR
- Remove .workato-ignore file that was accidentally added - Revert uv.lock to revision 3 from main branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
oalami
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added back a correctly generated uv.lock file, the rest LGTM
No description provided.