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

Support ConfigDict for 232 #747

Merged
merged 1 commit into from
Jul 15, 2023
Merged

Support ConfigDict for 232 #747

merged 1 commit into from
Jul 15, 2023

Conversation

koxudaxi
Copy link
Owner

@koxudaxi koxudaxi commented Jul 15, 2023

Related Issues: #694

* Support ConfigDict

* Support ConfigDict

* Get ConfigDictDefault

* ignore model_ prefix field

* Fix unittest

* Support model_config

* Get configDictDefaults

* Add configDict autocomplete

* Fix validation

* Add unittest

* Update documents

* add test case

* add configDictDefaults

* Fix cache access

* Fix cache clear
@koxudaxi koxudaxi changed the title Support ConfigDict (#738) Support ConfigDict for 232 Jul 15, 2023
@codecov
Copy link

codecov bot commented Jul 15, 2023

Codecov Report

Patch coverage: 61.25% and project coverage change: +0.03 🎉

Comparison is base (09346bd) 71.88% compared to head (fc5944c) 71.92%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #747      +/-   ##
==========================================
+ Coverage   71.88%   71.92%   +0.03%     
==========================================
  Files          25       25              
  Lines        1860     1916      +56     
  Branches      571      592      +21     
==========================================
+ Hits         1337     1378      +41     
- Misses        258      260       +2     
- Partials      265      278      +13     
Impacted Files Coverage Δ
...koxudaxi/pydantic/PydanticCompletionContributor.kt 74.88% <41.17%> (+0.12%) ⬆️
src/com/koxudaxi/pydantic/PydanticInspection.kt 85.64% <50.00%> (ø)
src/com/koxudaxi/pydantic/PydanticTypeProvider.kt 77.25% <50.00%> (ø)
src/com/koxudaxi/pydantic/PydanticCacheService.kt 60.00% <58.82%> (+2.42%) ⬆️
src/com/koxudaxi/pydantic/Pydantic.kt 76.88% <71.42%> (-0.29%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

Qodana for Python

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

  1. Register at Qodana Cloud and configure the action
  2. Use GitHub Code Scanning with Qodana
  3. Host Qodana report at GitHub Pages
  4. Inspect and use qodana.sarif.json (see the Qodana SARIF format for details)

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2023.1.5
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@koxudaxi koxudaxi merged commit 04aa57a into main Jul 15, 2023
4 of 5 checks passed
@koxudaxi koxudaxi deleted the support_ConfigDict_for_232 branch July 15, 2023 17:35
@skewty
Copy link

skewty commented Sep 1, 2023

from pydantic import BaseModel, Field, ConfigDict

class Payload(BaseModel):
    model_config = ConfigDict(populate_by_name=True)    
    test_field: int = Field(..., alias="testField")

Payload(test_field=12).model_dump()  # PyCharm Pro still complains about using "name" instead of "alias"

ConfigDict.populate_by_name support may not be complete or fully functioning yet.

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