Repository navigation
Support for delta sharing profile via options in python - #789
Conversation
e25f876 to
dca3753
Compare
|
This PR helps resolve #483 |
PatrickJin-db
left a comment
There was a problem hiding this comment.
Looks good, but let's add a test for good measure. I can do that tomorrow since you don't have access to the cloud credentials for our integration tests.
|
Sounds good, thanks @PatrickJin-db |
linzhou-db
left a comment
There was a problem hiding this comment.
@PatrickJin-db are you thinking of a test in the same PR or a separate one?
|
@kkoteeswaran in which version of delta-sharing-python would you need this? |
|
@linzhou-db is there any correlation between DBR and delta-sharing-python versions? We want to make sure this is available in the version that is tied to DBR 15.4 |
No there is no correlation. So seems like you are ok with using the latest delta-sharing-python version that includes this change? |
Yes, that works. Thanks @linzhou-db |
|
|
||
| def load_as_spark( | ||
| url: str, version: Optional[int] = None, timestamp: Optional[str] = None | ||
| url: str, |
There was a problem hiding this comment.
Can we add a check that the delta sharing profile cannot be in both url and delta_sharing_profile? In other words, if url contains a profile path, then delta_sharing_profile should not be populated, and vice versa.
There was a problem hiding this comment.
@PatrickJin-db the load_as_spark() passes the url to Spark and the validation is handled downstream in the Scala connector's parsePath() so it is not required here. Let me know if you think otherwise.
There was a problem hiding this comment.
a) since there is no guarantee on the spark version being called by this function, there could be versions that support and not support this, what's the behavior on each?
b) even so, fail it early and locally makes more sense to me, instead of assuming on downstream behaviors, which could change without control.
|
Also, adding a test in a separate PR is fine |
| "`load_table_changes_as_spark` requires running in a PySpark application." | ||
| ) | ||
| df = spark.read.format("deltaSharing").option("readChangeFeed", "true") | ||
| if delta_sharing_profile is not None: |
There was a problem hiding this comment.
this block of code is duplicate same as above can we have a helper method for this?
| "`load_as_spark` requires running in a PySpark application." | ||
| ) | ||
| df = spark.read.format("deltaSharing") | ||
| if delta_sharing_profile is not None: |
There was a problem hiding this comment.
this block of code is duplicate same as below can we have a helper method for this?
There was a problem hiding this comment.
@moderakh I have pulled that block of code out to a separate method
|
how is this PR going? |
|
@linzhou-db @moderakh @PatrickJin-db
Please let me know if any other changes are required. |
moderakh
left a comment
There was a problem hiding this comment.
LGTM from oauth perspective.
Adding support for delta sharing profile via options (reviving #573)
Separate PR for Scala - #786
Task List:
Examples
cc @prodeezy @stevenayers