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:
- Run the following command in the terminal or via a shell script:
scribe-data ec -od scribe_data_contracts
- 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.
Describe the bug
Running the
export_contracts(orec) command with the-odflag fails with anAttributeError. The CLI crashes instead of exporting the contracts to the specified directory.To Reproduce
Steps to reproduce the behavior:
scribe-data ec -od scribe_data_contractsAttributeError: '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
argparseconfiguration inmain.pypasses the-odargument as a standard string. However, theexport_contractsfunction insrc/scribe_data/cli/contracts/export.pyattempts to call.exists()on it, expecting apathlib.Pathobject.