Skip to content

Tech-debt: efficiency & de-duplication #147

Description

@GMMULLER

Summary

Non-functional cleanups flagged during review ("worth a pass"). Tracked as a checklist, not a single runtime bug:

Efficiency

  • get_dataset calls full list_catalog() twice (for include_hub in (True,False)) — catalog_listing.py:232
  • synchronous auto_install (full file copy) on the /processPythonCode response path
  • get_catalog_dir is an O(N) manifest scan per id
  • list_items lazily counts full CSV/GeoJSON rows inside the listing request
  • DuckDB connection torn down/reopened every exec — worker.py:222

Reuse / altitude

  • relativeTime/datasetCount/formatBytes copied 4× (exported in datasetDetailHelpers.ts)
  • KIND_TO_FORMAT vs SANDBOX_DATATYPE_TO_FORMAT; format→extension maps in 3 places; junk-label denylist in 3 places
  • publish_dataset hand-rolled id regex vs DATASET_DIR_RE
  • provenance.is_catalogable_output is a return True stub gated on as if it filters
  • buildOutputRefs reimplements buildSaveableLiveOutputs

Steps to Reproduce

By code inspection (see file references above); no runtime repro — these are perf/maintainability items.

Expected Result

Shared helpers/constants reused from a single source; per-id catalog lookups and per-exec DuckDB setup avoided; listing avoids full-file row counts and redundant list_catalog() passes.

Actual Result

Duplicated logic and redundant/synchronous work as itemized above.

Additional Information

Identified via static review of #123; low priority relative to Issues 1–4.

Metadata

Metadata

Assignees

Type

No type

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions