You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/sempy_labs/lakehouse/_shortcuts.py
+107Lines changed: 107 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -103,8 +103,12 @@ def create_shortcut_adls(
103
103
Parameters
104
104
----------
105
105
shortcut_name : str
106
+
The name of the shortcut.
106
107
location : str
108
+
Specifies the location of the target ADLS container. The URI must be in the format https://[account-name].dfs.core.windows.net where [account-name] is the name of the target ADLS account.
107
109
subpath : str
110
+
111
+
Specifies the container and subfolder within the ADLS account where the target folder is located. Must be of the format [container]/[subfolder] where [container] is the name of the container that holds the files and folders; [subfolder] is the name of the subfolder within the container (optional). For example: /mycontainer/mysubfolder.
108
112
connection: Union[str, UUID]
109
113
A string representing the connection that is bound with the shortcut. This can either be the connection Id or the connection name.
HTTP URL that points to the target bucket in S3. The URL should be in the format https://[bucket-name].s3.[region-code].amazonaws.com, where "bucket-name" is the name of the S3 bucket you want to point to, and "region-code" is the code for the region where the bucket is located. For example: https://my-s3-bucket.s3.us-west-2.amazonaws.com.
149
155
subpath : str
156
+
Specifies a target folder or subfolder within the S3 bucket.
150
157
connection: Union[str, UUID]
151
158
A string representing the connection that is bound with the shortcut. This can either be the connection Id or the connection name.
Creates a `shortcut <https://learn.microsoft.com/fabric/onelake/onelake-shortcuts>`_ to a Google Cloud Storage source.
193
+
194
+
Parameters
195
+
----------
196
+
shortcut_name : str
197
+
The name of the shortcut.
198
+
location : str
199
+
HTTP URL that points to the target bucket in GCS. The URL should be in the format https://[bucket-name].storage.googleapis.com, where [bucket-name] is the name of the bucket you want to point to. For example: https://my-gcs-bucket.storage.googleapis.com.
200
+
subpath : str
201
+
Specifies a target folder or subfolder within the GCS bucket. For example: /folder
202
+
connection: Union[str, UUID]
203
+
A string representing the connection that is bound with the shortcut. This can either be the connection Id or the connection name.
204
+
path : str, default="Tables"
205
+
A string representing the full path where the shortcut is created, including either "Files" or "Tables".
206
+
lakehouse : str, default=None
207
+
The Fabric lakehouse in which the shortcut will be created.
208
+
Defaults to None which resolves to the default lakehouse attached to the notebook.
209
+
workspace : str, default=None
210
+
The name of the Fabric workspace in which the shortcut will be created.
211
+
Defaults to None which resolves to the workspace of the attached lakehouse
212
+
or if no lakehouse attached, resolves to the workspace of the notebook.
213
+
"""
214
+
215
+
_create_shortcut_base(
216
+
shortcut_name=shortcut_name,
217
+
location=location,
218
+
subpath=subpath,
219
+
source="googleCloudStorage",
220
+
connection=connection,
221
+
path=path,
222
+
lakehouse=lakehouse,
223
+
workspace=workspace,
224
+
)
225
+
226
+
227
+
defcreate_shortcut_s3_compatible(
228
+
shortcut_name: str,
229
+
location: str,
230
+
subpath: str,
231
+
bucket: str,
232
+
connection: Union[str, UUID],
233
+
path: str="Tables",
234
+
lakehouse: Optional[str] =None,
235
+
workspace: Optional[str] =None,
236
+
):
237
+
"""
238
+
Creates a `shortcut <https://learn.microsoft.com/fabric/onelake/onelake-shortcuts>`_ to an S3 Compatible source.
239
+
240
+
Parameters
241
+
----------
242
+
shortcut_name : str
243
+
The name of the shortcut.
244
+
location : str
245
+
HTTP URL of the S3 compatible endpoint. This endpoint must be able to receive ListBuckets S3 API calls. The URL must be in the non-bucket specific format; no bucket should be specified here. For example: https://s3endpoint.contoso.com.
246
+
subpath : str
247
+
Specifies a target folder or subfolder within the S3 compatible bucket. For example: /folder
248
+
bucket : str
249
+
Specifies the target bucket within the S3 compatible location.
250
+
connection: Union[str, UUID]
251
+
A string representing the connection that is bound with the shortcut. This can either be the connection Id or the connection name.
252
+
path : str, default="Tables"
253
+
A string representing the full path where the shortcut is created, including either "Files" or "Tables".
254
+
lakehouse : str, default=None
255
+
The Fabric lakehouse in which the shortcut will be created.
256
+
Defaults to None which resolves to the default lakehouse attached to the notebook.
257
+
workspace : str, default=None
258
+
The name of the Fabric workspace in which the shortcut will be created.
259
+
Defaults to None which resolves to the workspace of the attached lakehouse
260
+
or if no lakehouse attached, resolves to the workspace of the notebook.
0 commit comments