Skip to content

Ruby 2.7 keyword arguments compatibility note

Thibaut Barrère edited this page Dec 5, 2020 · 2 revisions

⚠️ The information on this page is now obsolete. Kiba fully supports Ruby 2.7+ since v3.5.0.

==============

The way keyword arguments are handled by Ruby is changing gradually (in Ruby 2.7+).

As a declarative DSL, Kiba ETL is often used in conjunction with keyword arguments, so this is an important change.

Please read https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ carefully.

Kiba v3.0.0 status

Kiba v3.0.0 works fine with Ruby 2.7.0 (released on 2019-12-25), but in a number of situations (like with other apps), you will get warnings (not errors).

With Ruby 2.8.0 (currently being developed, which we'll refer to as 2.8.0-dev), these warnings will generally result in errors instead.

Possible solutions

Solutions for these situations are multiple (by order of preference):

  • Try out Kiba's ruby-3-compat-keyword-arguments branch: this is the official testing room for a transparent Ruby 3 keyword arguments support in Kiba. If successful (and more field testing is required to confirm this), this will be integrated in Kiba v3.5. This is the preferred path because it means that your ETL components initialize methods should normally not need any tweaking (the work is done on our side).
  • Alternatively: use the ruby2_keywords argument on your existing ETL components initialize method (see Ruby 2.7 section). This will work with Kiba v3.0.0 directly.
  • Finally: disable the deprecation warning (a temporary situation only valid for Ruby 2.7.0) with -W:no-deprecated or Warning[:deprecated] = false (see Will my code break on Ruby 2.7?) - this is only a quick fix and you will have to plan for a proper change.

Kiba companion gems status

  • Kiba Common also provides a ruby-3-compat-keyword-arguments branch to remove warnings with Ruby 2.7.0 and errors with Ruby 2.8.0-dev.
  • Kiba Pro 1.5.0 itself is compatible with Ruby 2.7.0+