Skip to content

Fix critical bug in date validation function and add comprehensive do…#62

Open
orbaps wants to merge 2 commits intofwitmer:masterfrom
orbaps:master
Open

Fix critical bug in date validation function and add comprehensive do…#62
orbaps wants to merge 2 commits intofwitmer:masterfrom
orbaps:master

Conversation

@orbaps
Copy link

@orbaps orbaps commented Oct 31, 2025

🐞 Critical Bug — Variable Name Error in validate_and_compare_dates() (DeeringAutoDownloadCode.py)

📘 Overview

During a detailed examination of the CoastlineExtraction repository, a critical bug was identified in the validate_and_compare_dates() function of DeeringAutoDownloadCode.py.
The issue causes a NameError whenever the function is executed, breaking the satellite data download pipeline, which is central to this project’s functionality.


🔍 Problem Description

In the function definition, the parameters are correctly named start_date and end_date.
However, inside the function body, undefined variables start_date_input and end_date_input are mistakenly used — leading to an immediate crash.

Buggy Code

def validate_and_compare_dates(start_date, end_date):
    start_date_obj = datetime.strptime(start_date_input, '%Y-%m-%d')  # ❌ Undefined variable
    end_date_obj = datetime.strptime(end_date_input, '%Y-%m-%d')      # ❌ Undefined variable

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