databricks-modules-vy 1.1.22__tar.gz → 1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/PKG-INFO +1 -1
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/sharepoint.py +10 -3
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/unity_catalog.py +5 -9
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy.egg-info/PKG-INFO +1 -1
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/pyproject.toml +1 -1
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/LICENSE +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/__init__.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/data_product.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/data_quality_tests.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/dataframe.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/extend_class.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/glue.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/logging.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/oracle.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/qlik.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/s3.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/service_platform.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/snaplogic.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/styringsinfo_postgres.py +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy.egg-info/SOURCES.txt +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy.egg-info/dependency_links.txt +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy.egg-info/top_level.txt +0 -0
- {databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/setup.cfg +0 -0
{databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/sharepoint.py
RENAMED
|
@@ -21,10 +21,17 @@ dbutils = DBUtils(spark)
|
|
|
21
21
|
def _get_sharepoint_ctx(site_name="VyMasterdata") -> ClientContext:
|
|
22
22
|
sharepoint_url = dbutils.secrets.get("SHAREPOINT", "url")
|
|
23
23
|
site_url = f"{sharepoint_url}/sites/{site_name}"
|
|
24
|
+
tenant = dbutils.secrets.get("SHAREPOINT", "tenant")
|
|
24
25
|
client_id = dbutils.secrets.get("SHAREPOINT", "app_id")
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
thumbprint = dbutils.secrets.get("SHAREPOINT", "cert_thumbprint")
|
|
27
|
+
private_key = dbutils.secrets.get("SHAREPOINT", "cert_private_key")
|
|
28
|
+
|
|
29
|
+
return ClientContext(site_url).with_client_certificate(
|
|
30
|
+
tenant=tenant,
|
|
31
|
+
client_id=client_id,
|
|
32
|
+
thumbprint=thumbprint,
|
|
33
|
+
private_key=private_key,
|
|
34
|
+
)
|
|
28
35
|
|
|
29
36
|
|
|
30
37
|
def _execute_query_with_backoff(
|
{databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/unity_catalog.py
RENAMED
|
@@ -185,21 +185,17 @@ def upsert_to_uc(
|
|
|
185
185
|
merge_condition += f" AND target.{key} = '{value}'"
|
|
186
186
|
|
|
187
187
|
if upsert_many:
|
|
188
|
+
# For upsert_many, remove all target rows for affected keys first,
|
|
189
|
+
# then append full source rows in one write.
|
|
190
|
+
df_keys = df.select(*upsert_keys).dropDuplicates()
|
|
188
191
|
(
|
|
189
192
|
target_table.alias("target")
|
|
190
|
-
.merge(
|
|
193
|
+
.merge(df_keys.alias("source"), merge_condition)
|
|
191
194
|
.whenMatchedDelete()
|
|
192
195
|
.execute()
|
|
193
196
|
)
|
|
194
197
|
|
|
195
|
-
|
|
196
|
-
target_table = DeltaTable.forName(spark, target)
|
|
197
|
-
(
|
|
198
|
-
target_table.alias("target")
|
|
199
|
-
.merge(df.alias("source"), merge_condition)
|
|
200
|
-
.whenNotMatchedInsertAll()
|
|
201
|
-
.execute()
|
|
202
|
-
)
|
|
198
|
+
df.write.mode("append").saveAsTable(target)
|
|
203
199
|
else:
|
|
204
200
|
(
|
|
205
201
|
target_table.alias("target")
|
|
File without changes
|
{databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/__init__.py
RENAMED
|
File without changes
|
{databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/data_product.py
RENAMED
|
File without changes
|
|
File without changes
|
{databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/dataframe.py
RENAMED
|
File without changes
|
{databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/extend_class.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/service_platform.py
RENAMED
|
File without changes
|
{databricks_modules_vy-1.1.22 → databricks_modules_vy-1.2}/databricks_modules_vy/snaplogic.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|