Skip to content

Fix: Ensure IMPORT_START_DATE is passed as string to strptime() #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pantcr7
Copy link

@pantcr7 pantcr7 commented Apr 13, 2025

Changed:
import_start_date = _safe_convert_date(config.IMPORT_START_DATE, "%Y%m%d") to:
import_start_date = _safe_convert_date(str(config.IMPORT_START_DATE), "%Y%m%d")

Reason:
The previous implementation caused a TypeError when IMPORT_START_DATE was an integer. Error traceback:
TypeError: strptime() argument 1 must be str, not int

Wrapping it in str() ensures compatibility with datetime.strptime().

Changed:
import_start_date = _safe_convert_date(config.IMPORT_START_DATE, "%Y%m%d")
to:
import_start_date = _safe_convert_date(str(config.IMPORT_START_DATE), "%Y%m%d")

Reason:
The previous implementation caused a TypeError when `IMPORT_START_DATE` was an integer.
Error traceback:
TypeError: strptime() argument 1 must be str, not int

Wrapping it in `str()` ensures compatibility with `datetime.strptime()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant