Skip to content
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

fix: set the task field during populate missing tasks for detached dao #80

Merged
merged 4 commits into from
Mar 4, 2024

Conversation

lchen-2101
Copy link
Collaborator

closes #79

Copy link

github-actions bot commented Feb 29, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/entities/models
  __init__.py
  dao.py
  dto.py
  src/entities/repos
  submission_repo.py
Project Total  

This report was generated by python-coverage-comment-action

Copy link
Contributor

@jcadam14 jcadam14 left a comment

Choose a reason for hiding this comment

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

Mainly question about the if in the pytest. And I'm thinking maybe a story at some point to rename some of the objects if you also think they're confusing (maybe it's just me coming back from vacation).

I thought for some reason that SQLAlchmey would handle populating the objects in tasks just be setting the task_names, it would handle the relationship building.

assert res1.lei == "1234567890"
assert len(res1.tasks) == 2
assert FilingTaskState.NOT_STARTED in set([t.state for t in res1.tasks])
tasks1 = set([task_state.task for task_state in res1.tasks if task_state.task])
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the if's needed here? With your update, shouldn't be a None to check for should there?

Also, is it just me or did I name these DAO/DTOs poorly, now that I read it? FilingTaskState, FilingTask, etc. Just doesn't read well, even I get confused what objects are being held where and I fricking wrote it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah yeap, if's not needed here, since if it's none, then the name wouldn't get populated either.
lol yeah, I'll come up with something more differentiating.

@lchen-2101
Copy link
Collaborator Author

Mainly question about the if in the pytest. And I'm thinking maybe a story at some point to rename some of the objects if you also think they're confusing (maybe it's just me coming back from vacation).

I thought for some reason that SQLAlchmey would handle populating the objects in tasks just be setting the task_names, it would handle the relationship building.

yeah, it's the attached / detached state; if we persisted the object, then the relationship probably would get built, but since it's just a newly constructed object, it doesn't try to acquire a connection to build it out is my educated guess.

Copy link
Contributor

@jcadam14 jcadam14 left a comment

Choose a reason for hiding this comment

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

looks good

@jcadam14 jcadam14 merged commit 6c04f90 into main Mar 4, 2024
3 checks passed
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.

Bug: fix filing task population missing field for dto serialization
2 participants