Fixed the Code Generation Script & Model CLI Description#671
Merged
srikanthbachala20 merged 3 commits intomasterfrom Jul 3, 2025
Merged
Fixed the Code Generation Script & Model CLI Description#671srikanthbachala20 merged 3 commits intomasterfrom
srikanthbachala20 merged 3 commits intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Improves string quoting consistency in the code generation script and adds special handling for string defaults in iterator contexts.
- Encloses
base_urlin single quotes to prevent formatting issues with special characters. - Adds a branch in
_set_default_valueto wrap string defaults in quotes when creating iterators.
Comments suppressed due to low confidence (1)
clarifai/runners/utils/code_script.py:323
- Add unit tests covering the new string-iterator branch, including edge cases where
default_valuecontains quotes or special characters.
if is_iterator:
Minimum allowed line rate is |
Merged
srikanthbachala20
added a commit
that referenced
this pull request
Jul 29, 2025
* Fixed the Code Generation Script & odel CLI Description * Fixed the Code Generation Script & odel CLI Description * Fixed the Code Generation Script & odel CLI Description
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes updates to the
clarifai/runners/utils/code_script.pyfile to improve string formatting and handle default values more robustly. The most important changes involve updating howbase_urlis formatted and refining the handling of iterators for string field types.String Formatting Improvements:
base_urlstring formatting inasync def main()to ensure the value is enclosed in single quotes, improving consistency and preventing potential issues with special characters. ([clarifai/runners/utils/code_script.pyL130-R130](https://github.com/Clarifai/clarifai-python/pull/671/files#diff-f990dbbc37fac6c569969b0e28e173a20b80fd30f5db1899e0f5b435b71f753dL130-R130))Default Value Handling:
_set_default_valuefunction to handle string field types (str) specifically when creating iterators, ensuring the default value is wrapped in single quotes for strings. ([clarifai/runners/utils/code_script.pyR324-R326](https://github.com/Clarifai/clarifai-python/pull/671/files#diff-f990dbbc37fac6c569969b0e28e173a20b80fd30f5db1899e0f5b435b71f753dR324-R326))