marshmallow-code / marshmallow-code/marshmallow-sqlalchemy

Use AwareDateTime when generating field from DateTime(timezone=True)

Open
#407 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
580
Forks
101
Avg merge
7h 6m
Merged PRs (30d)
3

Description

I didn't investigate this. I don't know if there would be an issue with this.

Basically, when I have a model with

```py
creation_date = sqla.Column(sqla.DateTime(timezone=True), nullable=False)
```

I need to override the auto field in the schema

```py
class ItemSchema(AutoSchema):
class Meta:
model = Item

id = msa.auto_field(dump_only=True)
creation_date = ma.fields.AwareDateTime(required=True)
```

I suppose this could be automatized.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by tracing AutoSchema's auto_field generation for SQLAlchemy DateTime(timezone=True) and compare it with the shown AwareDateTime override. Confirm the expected generated field and its coverage before deciding whether automation is appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlalchemy
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.