Skip to content

Commit

Permalink
fix(xmlupload): fix non-initialized variable (DEV-2922) (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Nov 10, 2023
1 parent b6943a2 commit afb16b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dsp_tools/utils/xmlupload/xmlupload.py
Expand Up @@ -157,6 +157,7 @@ def _upload(
) -> tuple[IriResolver, list[str]]:
# upload all resources, then update the resources with the stashed XML texts and resptrs
failed_uploads: list[str] = []
iri_resolver = IriResolver()
try:
iri_resolver, failed_uploads = _upload_resources(
resources=resources,
Expand All @@ -167,6 +168,7 @@ def _upload(
config=config,
project_client=project_client,
list_client=list_client,
id_to_iri_resolver=iri_resolver,
)
nonapplied_stash = (
_upload_stash(
Expand Down Expand Up @@ -283,6 +285,7 @@ def _upload_resources(
config: UploadConfig,
project_client: ProjectClient,
list_client: ListClient,
id_to_iri_resolver: IriResolver,
) -> tuple[IriResolver, list[str]]:
"""
Iterates through all resources and tries to upload them to DSP.
Expand All @@ -298,6 +301,7 @@ def _upload_resources(
config: the upload configuration
project_client: a client for HTTP communication with the DSP-API
list_client: a client for HTTP communication with the DSP-API
id_to_iri_resolver: a resolver for internal IDs to IRIs
Returns:
id2iri_mapping, failed_uploads
Expand All @@ -308,8 +312,6 @@ def _upload_resources(
json_ld_context = get_json_ld_context_for_project(project_client.get_ontology_name_dict())
listnode_lookup = list_client.get_list_node_id_to_iri_lookup()

id_to_iri_resolver = IriResolver()

resource_create_client = ResourceCreateClient(
con=con,
project_iri=project_iri,
Expand Down

0 comments on commit afb16b1

Please sign in to comment.