Skip to content

fix datetime fields handling #75

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

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

Conversation

ntarocco
Copy link
Contributor

@ntarocco ntarocco commented Apr 24, 2025

This PR is a draft, and requires more ❤️.

How to go about this:

  1. first, identify the issue by removing the casting str(since) in a job, and reproduce the issue
  2. then, fix the data flow by dumping/loading the param correctly. Internally, in the business logic, the since param should stay a Python datetime obj all the time, and converted to str (JSON) only at the resource layer.

@ntarocco ntarocco linked an issue Jul 4, 2025 that may be closed by this pull request
@@ -247,13 +254,20 @@ class Meta:
def wrap_args(self, obj, many, **kwargs):
"""Workaround for nested args."""
# it is possible job has no arguments, that's why we use .get
obj["args"] = {"args": obj.get("args", {})}
obj["args"] = obj.get("args", {})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kpsherva any memory on what we were trying to fix here with the nested obj?
Maybe passing custom args was not working correctly?

Copy link
Contributor

Choose a reason for hiding this comment

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

there is a problem with the structure when we serialize the arguments from the db, using the marshmallow schema. In one of the "load" or "dump" there is an additional level of args added, but I don't remember really why this is happening. I would try to remove it and see how it fails

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