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

fix no exist artifact read #753

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Conversation

LawyZheng
Copy link
Collaborator

@LawyZheng LawyZheng commented Aug 29, 2024

🚀 This description was created by Ellipsis for commit f5d5856

Summary:

Improved file existence checks in get_video_artifacts and get_har_data in skyvern/webeye/browser_manager.py to handle non-existent artifact files gracefully.

Key points:

  • Updated get_video_artifacts in skyvern/webeye/browser_manager.py to check if video_path exists before reading.
  • Removed FileNotFoundError exception handling in get_video_artifacts.
  • Updated get_har_data in skyvern/webeye/browser_manager.py to check if har_path exists before reading.
  • Ensures non-existent artifact files are handled gracefully without exceptions.

Generated with ❤️ by ellipsis.dev

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to f5d5856 in 10 seconds

More details
  • Looked at 39 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_I4KvBLIUumSm6a5n


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

try:
with open(path, "rb") as f:
browser_state.browser_artifacts.video_artifacts[i].video_data = f.read()
if path and os.path.exists(path=path):
Copy link
Contributor

Choose a reason for hiding this comment

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

os.path.exists should be called with path as a positional argument, not a keyword argument. This applies here and on line 146 as well.

Suggested change
if path and os.path.exists(path=path):
if path and os.path.exists(path):

@LawyZheng LawyZheng merged commit 2e11f24 into main Aug 29, 2024
2 checks passed
@LawyZheng LawyZheng deleted the lawy/fix-no-exist-artifact-read branch August 29, 2024 07:47
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.

1 participant