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

Add visitor to replace usages of postgres' FloatRangeFormField #198

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

browniebroke
Copy link
Owner

From Django 2.2 release notes:

The FloatRangeField model and form fields in django.contrib.postgres are deprecated in favor of a new name, DecimalRangeField, to match the underlying numrange data type used in the database.

This is removed in Django 3.1

@browniebroke browniebroke added the enhancement New feature or request label Sep 15, 2020
@browniebroke browniebroke force-pushed the feature/pg-floatrangefield branch from 595ab31 to 918c557 Compare September 15, 2020 20:45
@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #198 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #198   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        22    +1     
  Lines          626       639   +13     
=========================================
+ Hits           626       639   +13     
Impacted Files Coverage Δ
django_codemod/__init__.py 100.00% <100.00%> (ø)
django_codemod/visitors/__init__.py 100.00% <100.00%> (ø)
django_codemod/visitors/postgres_fields.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8d8182...37287d9. Read the comment docs.

From Django 2.2 release notes:

> The `FloatRangeField` model and form fields in `django.contrib.postgres` are deprecated
> in favor of a new name, `DecimalRangeField`, to match the underlying `numrange` data
> type used in the database.

This is removed in Django 3.1
@browniebroke browniebroke force-pushed the feature/pg-floatrangefield branch from 918c557 to 37287d9 Compare September 15, 2020 20:47
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 15, 2020

Sourcery Code Quality Report (beta)

❌  Merging this PR will decrease code quality in the affected files by 0.01 out of 10.

Quality metrics Before After Change
Complexity 0.05 0.05 0.00
Method Length 38.30 38.75 0.45 🔴
Quality 9.06 9.05 -0.01 🔴
Other metrics Before After Change
Lines 311 321 10
Changed files Quality Before Quality After Quality Change
django_codemod/visitors/init.py 8.32 8.21 -0.11 🔴
tests/test_cli.py 9.10 9.09 -0.01 🔴

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Overall Recommendation

Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@browniebroke browniebroke merged commit 92ecda0 into master Sep 15, 2020
@browniebroke browniebroke deleted the feature/pg-floatrangefield branch September 15, 2020 20:53
@browniebroke browniebroke added this to the Django 3.1 milestone Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant