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

Improvement/minor changes #268

Merged
merged 3 commits into from
Feb 14, 2024
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: 1 addition & 1 deletion connectors/huggingface/datasets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ mkdir -p $WORK_DIR
python3 connectors/synchronization.py \
-c connectors.huggingface.huggingface_dataset_connector.HuggingFaceDatasetConnector \
-w ${WORK_DIR} \
--save-every 100 > ${WORK_DIR}/connector.log 2>&1
--save-every 100 >> ${WORK_DIR}/connector.log 2>&1
8 changes: 7 additions & 1 deletion src/setup_logger.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import logging
from importlib.metadata import version

format_string = (
f"v{version('aiod_metadata_catalogue')}"
+ " %(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s"
)


def setup_logger():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s",
format=format_string,
datefmt="%Y-%m-%d %H:%M:%S",
)
6 changes: 4 additions & 2 deletions src/uploaders/zenodo_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ def _generate_metadata(self, dataset: Dataset, publish: bool) -> dict:
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=msg)

if not dataset.version:
msg = "A version of the dataset is required. Any string is accepted, however "
"the suggested format is a semantically versioned tag (more details at semver.org)."
msg = (
"A version of the dataset is required. Any string is accepted, however "
"the suggested format is a semantically versioned tag (more details at semver.org)."
)
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=msg)

if publish and not (dataset.is_accessible_for_free):
Expand Down
Loading