Skip to content

Commit

Permalink
💚 Iteration 1
Browse files Browse the repository at this point in the history
  • Loading branch information
falexwolf committed Sep 27, 2024
1 parent 63637e7 commit fcba3c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lamin_cli/_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def get_stem_uid_and_version_from_file(
)
version_pattern = re.compile(r'\.transform\.version\s*=\s*["\']([^"\']+)["\']')
elif file_path.suffix == ".ipynb":
track_pattern = re.compile(
r'ln\.track\(\s*(?:uid\s*=\s*)?\\["\']([^"\']+)\\["\']'
)
uid_pattern = re.compile(r'\.context\.uid\s*=\s*\\["\']([^"\']+)\\["\']')
stem_uid_pattern = re.compile(
r'\.transform\.stem_uid\s*=\s*\\["\']([^"\']+)\\["\']'
Expand Down
6 changes: 3 additions & 3 deletions tests/test_save_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ def test_run_save_cache():
)
# print(result.stdout.decode())
assert result.returncode == 1
assert "Did you run ?" in result.stdout.decode()
assert "Did you run `ln.track()`?" in result.stdout.decode()

# run the script
result = subprocess.run(
f"python {filepath}",
shell=True,
capture_output=True,
)
# print(result.stdout.decode())
# print(result.stderr.decode())
print(result.stdout.decode())
print(result.stderr.decode())
assert result.returncode == 0
assert "created Transform" in result.stdout.decode()
assert "m5uCHTTpJnjQ0000" in result.stdout.decode()
Expand Down

0 comments on commit fcba3c1

Please sign in to comment.