Skip to content

Commit 096ef56

Browse files
authored
Update how-to-mltable.md
1 parent 78db467 commit 096ef56

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

articles/machine-learning/how-to-mltable.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ Defining paths to read Delta Lake tables is different compared to the other file
487487
```python
488488
import mltable
489489

490-
# define the path containing the delta table (where the _delta_log file is stored)
490+
# define the cloud path containing the delta table (where the _delta_log file is stored)
491491
delta_table = "abfss://<file_system>@<account_name>.dfs.core.windows.net/<path_to_delta_table>"
492492

493493
# create an MLTable. Note the timestamp_as_of parameter for time travel.
@@ -497,6 +497,21 @@ tbl = mltable.from_delta_lake(
497497
)
498498
```
499499

500+
If you want to get the latest version of Delta Lake data, you can pass current timestamp into `timestamp_as_of`.
501+
502+
```python
503+
import mltable
504+
505+
# define the relative path containing the delta table (where the _delta_log file is stored)
506+
delta_table_path = "./working-directory/delta-sample-data"
507+
508+
# get the current timestamp in the required format
509+
current_timestamp = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
510+
print(current_timestamp)
511+
tbl = mltable.from_delta_lake(delta_table_path, timestamp_as_of=current_timestamp)
512+
df = tbl.to_pandas_dataframe()
513+
```
514+
500515
### Files, folders and globs
501516

502517
Azure Machine Learning Tables support reading from:

0 commit comments

Comments
 (0)