Skip to content

Conversation

@mnoszczak
Copy link
Contributor

No description provided.

@mnoszczak mnoszczak force-pushed the mno/x-0-fix-default-values branch from 46265d4 to c5bc124 Compare February 6, 2023 12:13
@mnoszczak mnoszczak requested a review from msokoloff1 February 6, 2023 16:39
_params = params or {}
def export_v2(self,
task_name: Optional[str] = None,
params: Optional[ModelRunExportParams] = {}) -> Task:
Copy link
Contributor

Choose a reason for hiding this comment

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

Assigning a default argument of a dict is bad practice. It isn't re-defined for each function invokation, only when the function is defined.

https://stackoverflow.com/questions/26320899/why-is-the-empty-dictionary-a-dangerous-default-value-in-python

Technically you aren't modifying this so it should be fine. Also, optional means default value of None - not that it has a default.

I would revert back to how you have it. But just set the value to None by default.

@mnoszczak mnoszczak requested a review from msokoloff1 February 7, 2023 22:06
@mnoszczak mnoszczak force-pushed the mno/x-0-fix-default-values branch from 2cfcc56 to 2cfd661 Compare February 9, 2023 11:37
@mnoszczak mnoszczak changed the title [X-0] Handle default values properly [AL-4919] Make params optional, add task result to export task type Feb 9, 2023
@mnoszczak mnoszczak force-pushed the mno/x-0-fix-default-values branch 2 times, most recently from 99bb8b9 to 002d5d9 Compare February 9, 2023 15:25
@mnoszczak mnoszczak force-pushed the mno/x-0-fix-default-values branch from 002d5d9 to b1c55c2 Compare February 9, 2023 16:50


@pytest.mark.skip(reason="feature under development")
# @pytest.mark.skip(reason="feature under development")
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just delete this line instead of commenting it out

Copy link
Contributor

Choose a reason for hiding this comment

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

Although I think exports v2 is broken in staging right now.. Maybe leave this until it is more stable.

@msokoloff1 msokoloff1 self-requested a review February 9, 2023 21:42
@mnoszczak mnoszczak merged commit 2df204f into develop Feb 9, 2023
@mnoszczak mnoszczak deleted the mno/x-0-fix-default-values branch February 9, 2023 23:10
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.

3 participants