Skip to content

Bug: AttributeError when exporting contracts via CLI with -od flag #708

Description

@DeleMike

Describe the bug
Running the export_contracts (or ec) command with the -od flag fails with an AttributeError. The CLI crashes instead of exporting the contracts to the specified directory.

To Reproduce
Steps to reproduce the behavior:

  1. Run the following command in the terminal or via a shell script:
    scribe-data ec -od scribe_data_contracts
  2. See error:
    AttributeError: 'str' object has no attribute 'exists'

Expected behavior
The CLI should successfully create the directory (if it doesn't exist) and export the data contracts without crashing.

Root Cause
The argparse configuration in main.py passes the -od argument as a standard string. However, the export_contracts function in src/scribe_data/cli/contracts/export.py attempts to call .exists() on it, expecting a pathlib.Path object.

Metadata

Metadata

Assignees

Labels

-priority-High prioritybugSomething isn't working

Type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions