koxudaxi / datamodel-code-generator

Pydantic model and dataclasses.dataclass generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.
https://koxudaxi.github.io/datamodel-code-generator/
MIT License
2.65k stars 296 forks source link

🚑 fixes graphql parser --use-standard-collections --use-union-operator --use-annotated #2016

Closed bpsoos closed 2 months ago

bpsoos commented 3 months ago

resolves #1941

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (202c0b8) to head (7a33cd8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2016 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 38 38 Lines 4197 4199 +2 Branches 967 967 ========================================= + Hits 4197 4199 +2 ``` | [Flag](https://app.codecov.io/gh/koxudaxi/datamodel-code-generator/pull/2016/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/koxudaxi/datamodel-code-generator/pull/2016/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono) | `99.66% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codspeed-hq[bot] commented 3 months ago

CodSpeed Performance Report

Merging #2016 will create unknown performance changes

Comparing bpsoos:fix/1941-graphql-options (7a33cd8) with main (202c0b8)

Summary

🆕 29 new benchmarks ⁉️ 29 dropped benchmarks

:warning: Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main bpsoos:fix/1941-graphql-options Change
🆕 test_main_all_of_ref N/A 52.2 ms N/A
🆕 test_main_autodetect N/A 72.4 ms N/A
🆕 test_main_external_definitions N/A 55.9 ms N/A
🆕 test_main_inheritance_forward_ref N/A 138 ms N/A
🆕 test_main_inheritance_forward_ref_keep_model_order N/A 139.4 ms N/A
🆕 test_main_json_reuse_enum_default_member N/A 99.2 ms N/A
🆕 test_main_jsonschema_complex_any_of N/A 71.5 ms N/A
🆕 test_main_jsonschema_external_files N/A 53.1 ms N/A
🆕 test_main_jsonschema_field_include_all_keys N/A 71.2 ms N/A
🆕 test_main_jsonschema_id N/A 59.7 ms N/A
🆕 test_main_jsonschema_multiple_files N/A 96 ms N/A
🆕 test_main_jsonschema_nested_deep N/A 87.6 ms N/A
🆕 test_main_jsonschema_special_field_name N/A 73.9 ms N/A
🆕 test_main_nested_directory N/A 279.1 ms N/A
🆕 test_main_root_id_jsonschema_self_refs_with_local_file N/A 100.1 ms N/A
🆕 test_main_root_id_jsonschema_self_refs_with_remote_file N/A 99.5 ms N/A
🆕 test_main_strict_types N/A 93.4 ms N/A
🆕 test_main_strict_types_all_with_field_constraints N/A 88.3 ms N/A
🆕 test_force_optional N/A 161.5 ms N/A
🆕 test_main N/A 148.6 ms N/A
... ... ... ... ...


:information_source: Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

bpsoos commented 3 months ago

Hello @koxudaxi,

Sorry for the large diff. Most of it is just refactor. The actual fix is contained in these commits.

The rest of the changes included (only refactor of tests/test data):

My aim here was to reduce directory sizes and LoC/file, in order to improve maintainability.

Let me know what you think!

koxudaxi commented 3 months ago

@bpsoos Thanks for the great PR. Sorry, the test coverage was broken, but I have fixed it. The PR has quite a few conflicts. Can you please fix them?

bpsoos commented 3 months ago

@koxudaxi I think I have fixed all of the conflicts