from kirin import Dataset
dataset = Dataset(
root_dir="{{ catalog.root_dir }}",
name="{{ dataset_name }}"{% if catalog.aws_profile %},
aws_profile="{{ catalog.aws_profile }}"{% endif %}{% if catalog.gcs_token %},
gcs_token="{{ catalog.gcs_token }}"{% endif %}{% if catalog.gcs_project %},
gcs_project="{{ catalog.gcs_project }}"{% endif %}{% if catalog.azure_account_name %},
azure_account_name="{{ catalog.azure_account_name }}"{% endif %}{% if catalog.azure_account_key %},
azure_account_key="{{ catalog.azure_account_key }}"{% endif %}{% if catalog.azure_connection_string %},
azure_connection_string="{{ catalog.azure_connection_string }}"{% endif %}
)
{% if current_commit %}
# Checkout to latest commit (HEAD)
dataset.checkout("{{ current_commit }}")
{% else %}
# Checkout to latest commit (HEAD)
dataset.checkout()
{% endif %}
# Add files to the dataset
dataset.commit(
message="Your commit message here",
add_files=["path/to/your/file1.csv", "path/to/your/file2.json"]
)
# Remove files from the dataset
# dataset.commit(
# message="Remove outdated files",
# remove_files=["old_file.csv", "deprecated.json"]
# )
# CLI Commands (placeholder for CLI usage)
# kirin commit --message "Your commit message" --add path/to/file.txt
# kirin commit --message "Remove files" --remove old_file.csv