Skip to content
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

modify the python filename extraction #1129

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

modify the python filename extraction #1129

wants to merge 1 commit into from

Conversation

JieyuZ2
Copy link
Collaborator

@JieyuZ2 JieyuZ2 commented Jul 14, 2023

Why are these changes needed?

modify from
code[11 : code.find("\n")].strip()
to
code[11 : code.find(".py")].strip() + '.py'

otherwise, invalid python file name would cause issue in committing current docker

Checks

modify from 
`code[11 : code.find("\n")].strip()`
to 
`code[11 : code.find(".py")].strip() + '.py'`

otherwise, invalid python file name would cause issue in committing current docker
@@ -91,7 +91,7 @@ def _execute_code(self, code_blocks):
logs = logs.decode("utf-8")
elif lang in ["python", "Python"]:
if code.startswith("# filename: "):
filename = code[11 : code.find("\n")].strip()
filename = code[11 : code.find(".py")].strip() + '.py'
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the file ends with ".sh" or others?

@sonichi
Copy link
Contributor

sonichi commented Jul 14, 2023

Please use https://microsoft.github.io/FLAML/docs/Contribute#pre-commit to pass code format check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants