gemini-code-assist[bot] commented on code in PR #35733:
URL: https://github.com/apache/beam/pull/35733#discussion_r2241458220


##########
sdks/python/scripts/run_pytest.sh:
##########
@@ -41,17 +48,29 @@
 # Initialize the user_marker variable.
 user_marker=""
 
-# Isolate the user-provided -m argument (matching only).
-if [[ $pytest_args =~ "-m" ]]; then
-  # Extract the marker value using the defined regex.
-  user_marker=$(echo "$pytest_args" | sed -nE "s/.*$marker_regex.*/\1/p")
-fi
+# Define regex pattern for quoted strings
+quotes_regex="^[\"\'](.*)[\"\']$"

Review Comment:
   You're right that the current input is expected to have valid, matching 
quotes. However, adopting a more robust regex like `^(["'])(.*)\1$` (which uses 
a backreference `\1` to match the closing quote to the opening one) is 
generally a good practice. It makes the code more resilient to potential future 
changes or unexpected edge cases where the input might not strictly adhere to 
the assumed format. It's a small change that adds a layer of defense against 
future bugs without negatively impacting current functionality.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to