Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the original registering root_dir to the database table #87

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/create_registry_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ def _Dataset(schema):
"data_org": Column("data_org", String, nullable=False),
"nfiles": Column("nfiles", Integer, nullable=False),
"total_disk_space": Column("total_disk_space", Float, nullable=False),
# What `root_dir` was the data originially ingested into
"register_root_dir": Column(String, nullable=False),
}

# Table metadata
Expand Down
1 change: 1 addition & 0 deletions src/dataregistry/registrar.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ def register_dataset(
values["data_org"] = dataset_organization
values["nfiles"] = num_files
values["total_disk_space"] = total_size / 1024 / 1024 # Mb
values["register_root_dir"] = self._root_dir

# Create a new row in the data registry database.
with self._engine.connect() as conn:
Expand Down
Loading