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

Making a few protected functions public for raw file ingestion #125

Merged
merged 1 commit into from
Jul 5, 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
4 changes: 2 additions & 2 deletions src/pfb/importers/gen3dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def from_dict(ctx, url_or_path):
"""
try:
with ctx.obj["writer"] as writer:
_from_dict(writer, url_or_path)
write_from_dict(writer, url_or_path)
except Exception:
click.secho("Failed!", fg="red", bold=True, err=True)
raise


def _from_dict(writer, url_or_path):
def write_from_dict(writer, url_or_path):
if writer.isatty:
click.secho("Error: cannot output to TTY.", fg="red", bold=True, err=True)
return
Expand Down
4 changes: 2 additions & 2 deletions src/pfb/importers/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def _from_json(metadata, path, program, project):
if isinstance(json_data, dict):
json_data = [json_data]
for json_record in json_data:
record = _convert_json(node_name, json_record, program, project, link_dests)
record = convert_json(node_name, json_record, program, project, link_dests)
yield record


def _convert_json(node_name, json_record, program, project, link_dests):
def convert_json(node_name, json_record, program, project, link_dests):
relations = []
try:
node_id = json_record["submitter_id"]
Expand Down