Fix file not found error#2079
Conversation
|
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
| except OSError as oe: | ||
| logger.debug(f"Error in getting {from_path} to {to_path} rec {recursive} {oe}") | ||
| if not file_system.exists(from_path): | ||
| raise Exception(f"File not found in {from_path}") |
There was a problem hiding this comment.
nit:
| raise Exception(f"File not found in {from_path}") | |
| raise FlyteValueException(f"File not found in {from_path}") |
| v = os.environ.get(env_var) | ||
| if v is not None: | ||
| return v | ||
| return v.strip() |
There was a problem hiding this comment.
I think it's because of this PR.
https://github.com/flyteorg/flytekit/pull/2077/files
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2079 +/- ##
==========================================
+ Coverage 85.71% 85.75% +0.03%
==========================================
Files 313 313
Lines 23396 23428 +32
Branches 3501 3511 +10
==========================================
+ Hits 20055 20090 +35
+ Misses 2733 2731 -2
+ Partials 608 607 -1 ☔ View full report in Codecov by Sentry. |
0711848 to
ae24e12
Compare
Signed-off-by: Austin Liu <austin362667@gmail.com> reorder import Signed-off-by: Austin Liu <austin362667@gmail.com> fix received_value Signed-off-by: Austin Liu <austin362667@gmail.com>
| return to_path | ||
| except OSError as oe: | ||
| logger.debug(f"Error in getting {from_path} to {to_path} rec {recursive} {oe}") | ||
| if not file_system.exists(from_path): |
There was a problem hiding this comment.
is it possible to raise an error without an additional network call? e.g. are we able to check the error code (404) from oe?
There was a problem hiding this comment.
Neat, but I've tried oe.errno == FileNotFoundError.errno: and it failed to catch the 404 error.
I think it's ignorable wrt the performance issue, since it's already trapped in the exception handling process.
Future-Outlier
left a comment
There was a problem hiding this comment.
LGTM, wait for your error code reply!
67f80b6
|
Congrats on merging your first pull request! 🎉 |

Tracking issue
flyteorg/flyte#4470
Why are the changes needed?
flyteorg/flyte#4470
Flytekit should raise a file not found error instead of Access denied
What changes were proposed in this pull request?
Raise an exception if the path doesn't exist on the filesystem when
dst = file_system.get(from_path, to_path, recursive=recursive, **kwargs)catches OSError.How was this patch tested?
Setup process
minio)Screenshots
Check all the applicable boxes
Related PRs
Docs link