Skip to content

Comments

fix: id typing#405

Open
Mokto wants to merge 1 commit intoart049:masterfrom
Mokto:fix-id-typing
Open

fix: id typing#405
Mokto wants to merge 1 commit intoart049:masterfrom
Mokto:fix-id-typing

Conversation

@Mokto
Copy link
Contributor

@Mokto Mokto commented Jan 13, 2024

No description provided.

@codecov
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.14%. Comparing base (a03c327) to head (1c96982).
Report is 22 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #405   +/-   ##
=======================================
  Coverage   99.14%   99.14%           
=======================================
  Files          52       52           
  Lines        5057     5057           
  Branches      712      712           
=======================================
  Hits         5014     5014           
  Misses         39       39           
  Partials        4        4           
Flag Coverage Δ
tests-3.10-4.4-standalone 93.61% <ø> (ø)
tests-3.10-5-standalone 93.61% <ø> (ø)
tests-3.10-6-standalone 93.61% <ø> (ø)
tests-3.11-4-replicaSet 98.99% <ø> (ø)
tests-3.11-4.2-sharded 93.61% <ø> (ø)
tests-3.11-4.4-standalone 93.61% <ø> (ø)
tests-3.11-5-standalone 93.61% <ø> (ø)
tests-3.11-6-standalone 93.61% <ø> (ø)
tests-3.8-4.4-standalone 93.56% <ø> (ø)
tests-3.8-5-standalone 93.56% <ø> (ø)
tests-3.8-6-standalone 93.56% <ø> (ø)
tests-3.9-4.4-standalone 93.52% <ø> (ø)
tests-3.9-5-standalone 93.52% <ø> (ø)
tests-3.9-6-standalone 93.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@art049
Copy link
Owner

art049 commented Mar 18, 2024

Thanks for the PR. Any reason for removing this Field() I understand this is not useful since it's only there when type checking but did you encounter any bug that made you open this?

@Noah-Haf
Copy link

Noah-Haf commented Jul 27, 2024

+1

@art049 When using a tool such as pylance we get a VS code Problem (Argument missing for parameter "id") if we do not provide an id when defining a class.

You could alternatively do:

id: Union[ObjectId, Any] = Field(default=None) 

Example of issue:

from odmantic import Model

class testing(Model):
	name: str

return await engine.save(
    testing(
        name="hi"
    )
)

Problem: Argument missing for parameter "id"

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