-
Notifications
You must be signed in to change notification settings - Fork 19
Check for negative values before doing substr #32
Check for negative values before doing substr #32
Conversation
Looking at the GitHub Actions, there is a little clean-up required still. The test you added is failing for some reason.
CC @datapythonista to comment on whether |
Thanks for the contribution, by the way! And for adding tests :-) |
To me, for the long term, it'd make sense that the operation registry is a class, and that all these translation functions are their methods. And that you can subclass the registry that makes sense (one that translates to SQL strings, or SQLAlchemy operations mainly), and overwrite what changes from a default. So, making that public doesn't seem great, since I'd like to move it in the future. Didn't check for bigquery, but do you create your operation registry (now a dict, not a class) from scratch, or do you use a copy of the base registry, and update it? I've seen both things depending on the backend. If you create it from scratch, but want to reuse that function, you can start by the base, or also import the base, and use Does it make sense? |
Looks like ibis-bigquery/ibis_bigquery/compiler.py Lines 367 to 369 in 58d624a
|
Shouldn't we then simply remove that operation from the update, and leave the orginal one? Not sure if I fully understood what was the problem here. |
thanks for the discussion @datapythonista @tswast ! I wanted to do something like:
is there a better way to access the |
also about the unit tests, I see a bunch of
I guess this is due to the move to the new repo, right? is there something else that I need to change? |
Hmm... The other tests have the same thing and were running okay. Maybe that's because we hadn't deleted the backend from the root repo yet when I last ran these? Filed #33 to clean these up. |
Does |
This should still work. Are you install this same package with pip? Like |
Now that I'm merged #37 if you pull the latest, the unit tests should actually execute the logic from this repo. |
bbcbc12
to
0f9a88c
Compare
done, let's wait for the ci workflow to run then 👍 |
hey @tswast , do you mind approving the workflow to see if all tests/checks pass on this PR please? |
Looks like all the tests passed. Thanks for the contribution! |
hey @tswast ,
I took a swing at https://github.com/ibis-project/ibis/issues/1629
What I'd have wanted was to use the
ibis.backends.base.sql.string.registry.substring
method but that requires changes to theibis.backends.base.sql.registry.__init__.py
and so on to make it visible here.For the time being I copied the
substring
implementation here, but I could open a PR on theibis
repo to make thesubstring
method visible, and then we could use it here directly.Anyway, let me know what you think