Skip to content

deepretro.utils.az mis-handles absolute and unset config paths #185

@shreyasvinaya

Description

@shreyasvinaya

Summary

deepretro.utils.az builds config paths with raw string concatenation against the repo root:

AZ_MODEL_CONFIG_PATH = f"{root_dir}/{os.getenv('AZ_MODEL_CONFIG_PATH')}"
AZ_MODELS_PATH = f"{root_dir}/{os.getenv('AZ_MODELS_PATH')}"

Affected code

  • deepretro/utils/az.py

Problems

  1. Absolute env-var paths are mangled.
    • If AZ_MODEL_CONFIG_PATH=/tmp/config.yml, the effective path becomes <repo-root>//tmp/config.yml.
  2. Unset env vars become literal .../None paths.
  3. The path handling is inconsistent with normal user expectations for environment-provided file paths.

Why this matters

This makes valid external configurations fail unexpectedly, especially in CI, notebooks, or shared environments where configs live outside the repo.

Expected behavior

  • Absolute env-var paths should be used as-is.
  • Relative env-var paths can optionally be resolved against the project root.
  • Missing env vars should stay missing and trigger a clear error later, not silently turn into .../None.

Suggested direction

Use Path-based resolution with explicit handling for:

  • unset values
  • absolute paths
  • relative paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions