Skip to content

Baraah A. - #2

Open
thebaraah wants to merge 1 commit into
HackYourAssignment:mainfrom
thebaraah:main
Open

thebaraah wants to merge 1 commit into
HackYourAssignment:mainfrom
thebaraah:main

Conversation

@thebaraah

Copy link
Copy Markdown

No description provided.

@qiraahmad

Copy link
Copy Markdown

Strong submission, pipeline output is correct, tests pass, and Azure upload looks good! 4/5

Comment thread task-1/src/models.py
Comment on lines +45 to +48
if self.price < 0 :
return ValueError(f"Invalid price {self.price} the price can not be negative!")
if not self.product_name.strip():
return ValueError("product name can not empty or has a whitespace!") No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return ValueError(...) does not stop execution or reject bad data, it just returns a ValueError object that gets thrown away. Nothing ever raises. Replace return with raise.

Comment thread task-1/src/config.py
raise NotImplementedError("Implement _required: see TODO 2 in config.py")

value = os.environ.get(name)
if value is None :

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small edge case: os.environ.get(name) returns "" (empty string) for a set-but-empty variable, not None. Your check if value is None would let an empty path through.

Safer pattern would be:

value = os.environ.get(name)
if not value:
    raise ValueError(f"Missing environment variable {name}. See .env.example")

Comment thread task-1/src/transforms.py
Comment on lines +51 to +52
if rows is None:
return[]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if rows is None: return [] guard is fine after your debugging experience. Your upstream function returned None instead of a list. Fixing the source is often better than guarding everywhere, but both approaches are valid to discuss.

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.

2 participants