Return destination GCS URIs from ADLSToGCSOperator#61463
Return destination GCS URIs from ADLSToGCSOperator#61463Abhishekmishra2808 wants to merge 4 commits intoapache:mainfrom
Conversation
SameerMesiah97
left a comment
There was a problem hiding this comment.
Looks good overall. But this would benefit from some more polish.
There was a problem hiding this comment.
It looks like dest_gcs_bucket, dest_gcs_prefix = _parse_gcs_url(self.dest_gcs) will return the same value regardless of the iteration as self.dest_gcs is constant. Any reason why it can't be moved outside the loop?
There was a problem hiding this comment.
I would suggest using posixpath.join(dest_gcs_prefix, obj) as the behavior of os.path.join is OS dependent. On windows, it can result in the \\ separator being used during construction, resulting in an invalid path. Now, it won't cause issues in 99% of cases but for the odd contributor running this code locally on their windows machine, os.path.join can definitely cause issues. This is more of a nit though.
There was a problem hiding this comment.
nit for the nit: I assumed you meant PosixPath from Pathlib :)
The odd contributor won't be odd if #10388 gets resolved (not that I think it will happen anytime soon)
There was a problem hiding this comment.
nit for the nit: I assumed you meant
PosixPathfromPathlib:) The odd contributor won't be odd if #10388 gets resolved (not that I think it will happen anytime soon)
Yes. My point is that path construction should be OS agnostic. If the function you mentioned is the acceptable one, then that is the one the author should use. Thank you for calling that out.
providers/google/tests/unit/google/cloud/transfers/test_adls_to_gcs.py
Outdated
Show resolved
Hide resolved
providers/google/tests/unit/google/cloud/transfers/test_adls_to_gcs.py
Outdated
Show resolved
Hide resolved
shahar1
left a comment
There was a problem hiding this comment.
Please resolve comment made by @SameerMesiah97 (great review!),
and I think that it will be good to go.
I recall that we should run the system tests before merging this PR to ensure that they don't break, please let us know if you're able to do it - otherwise Google team or someone else will have to do it.
There was a problem hiding this comment.
nit for the nit: I assumed you meant PosixPath from Pathlib :)
The odd contributor won't be odd if #10388 gets resolved (not that I think it will happen anytime soon)
a6488b4 to
3583457
Compare
3583457 to
aef396e
Compare
|
@shahar1 @SameerMesiah97 Could you please check now, and tell if something is missing on my end. |
|
@shahar1 Also, it seems this change may already be reflected in |
Related: #11323
execute()now returns alist[str]of destination GCS URIs (gs://bucket/object) for uploaded files.list[str]; only the returned values are updated to reflect the destination in GCS.