Skip to content

DCAT-US 3.0 converter CLI never writes output (inverted conditional) #6281

Description

@akuny

Fix for a defect described here: GSA/inventory-app#955 (comment)

In the GSA/inventory-app repository, inckanext/datagov_inventory/dcat/dcat_converter.py, lines 250-255:

if dry_run:
    click.echo("Dry run complete.")
elif results["error"] is False:
    click.echo("Could not convert.")
else:
    export_converted_catalog(converted_catalog, output_dir)

results starts as {"error": False, ...}. The only writes to results["error"] are the two except handlers, both after line 250, so if either fired we'd never reach :252. It's provably False there.

Effect: every non-dry-run invocation takes the elif. No catalog.json is written, "Could not convert." prints on success, and the command still exits 0, reporting conversion_successful: True whenever every dataset validated. export_converted_catalog is unreachable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

DCAT-US3Tickets related to DCAT-US3 release and support.bugSoftware defect or bug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions