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

Fix pg 1.5.0 deprecation warning #48048

Merged
merged 1 commit into from
Apr 25, 2023
Merged

Conversation

morgoth
Copy link
Member

@morgoth morgoth commented Apr 24, 2023

Closes #48046

/cc @yahonda

@morgoth
Copy link
Member Author

morgoth commented Apr 24, 2023

@yahonda Looks like the test failures are somehow related to the pg gem upgrade, so there might be some bigger problems than only deprecation warning.

@yahonda
Copy link
Member

yahonda commented Apr 24, 2023

Right. We will need to address these two failures with pg 1.5.0 gem.

https://buildkite.com/rails/rails/builds/95886#0187b335-ed2c-4532-8176-68ae11d2a67f/1076-1087

Failure:
BasicsTest#test_preserving_time_objects_with_time_with_zone_conversion_to_default_timezone_local [/rails/activerecord/test/cases/base_test.rb:324]:
--- expected
+++ actual
@@ -1 +1 @@
-Sat, 01 Jan 2000 00:00:00.000000000 CST -06:00
+2000-01-01 01:00:00 UTC
 
 
bin/rails test /rails/activerecord/test/cases/base_test.rb:317
 
........................................F
 
Failure:
BasicsTest#test_preserving_time_objects_with_utc_time_conversion_to_default_timezone_local [/rails/activerecord/test/cases/base_test.rb:310]:
Expected: 2000-01-01 00:00:00 UTC
  Actual: 1999-12-31 19:00:00 UTC
 
bin/rails test /rails/activerecord/test/cases/base_test.rb:304

@yahonda
Copy link
Member

yahonda commented Apr 24, 2023

Opened #48049 for these two failures.

@dima4p
Copy link

dima4p commented Apr 24, 2023

Yes, please fix it.

Gemfile.lock Outdated
@@ -358,7 +358,7 @@ GEM
parser (3.2.1.1)
ast (~> 2.4.1)
path_expander (1.1.1)
pg (1.4.5)
pg (1.5.0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this change is not required since Rails CI will remove the Gemfile.lock and perform a bundle install, but for clarity, Let's change the pg gem version to 1.5.1 that includes the fix for #48049
https://github.com/rails/buildkite-config/blob/cde08283a7f570c1b0185eb626f835e393350801/Dockerfile#L134

Gemfile.lock Outdated Show resolved Hide resolved
@morgoth
Copy link
Member Author

morgoth commented Apr 25, 2023

@yahonda I updated the pg version

@yahonda yahonda merged commit e93bd8f into rails:main Apr 25, 2023
@yahonda
Copy link
Member

yahonda commented Apr 25, 2023

Thank you for the fix.

yahonda added a commit to yahonda/rails that referenced this pull request Apr 25, 2023
@yahonda
Copy link
Member

yahonda commented Apr 25, 2023

Backported to 7-0-stable branch via 71503fb

@Kaakati
Copy link

Kaakati commented Apr 25, 2023

@yahonda This issue is preventing new projects from running properly, are you going to patch the current gem today?

PG::Coder.new(hash) is deprecated. Please use keyword arguments instead!

@morgoth morgoth deleted the pg-1-5-warning branch April 25, 2023 07:37
@yahonda
Copy link
Member

yahonda commented Apr 25, 2023

No, I do not think so. You can use the 7-0-stable branch to suppress this warning if necessary.

@yahonda
Copy link
Member

yahonda commented May 26, 2023

FYI Rails 7.0.5 has been released that includes this fix

@timestamp_decoder = decoder_class.new(**@timestamp_decoder.to_h)

@dima4p
Copy link

dima4p commented May 26, 2023

FYI Rails 7.0.5 has been released that includes this fix

Thanks a lot.

@iraszl
Copy link

iraszl commented Jun 15, 2023

Will this be applied to Rails 6 as well?

@HunterMeyer
Copy link

Thanks @morgoth

nevans pushed a commit to nevans/rails that referenced this pull request Jun 27, 2023
@nevans
Copy link

nevans commented Jul 7, 2023

Will this be applied to Rails 6 as well?

@iraszl It won't. Rails 6.1 only receives security fixes (see #48435 (comment)). You could use the version in #48435, but you're probably better off putting in the effort to upgrade to rails 7.0 (or temporarily downgrade pg).

gschlager added a commit to discourse/discourse that referenced this pull request Oct 13, 2023
We stopped upgrading due to deprecation notices in Rails. See #21271 (comment)
But pg 1.5.3 and Rails 7.0.5 should have fixed the issue. See rails/rails#48046 (comment) and rails/rails#48048 (comment)
gschlager added a commit to discourse/discourse that referenced this pull request Oct 23, 2023
We stopped upgrading due to deprecation notices in Rails. See #21271 (comment)

pg 1.5.3 and Rails 7.0.5 should have fixed the issue. See rails/rails#48046 (comment) and rails/rails#48048 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PG adapter deprecation in recent release
7 participants