Skip to content

Get rid of pandas dependency #291

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

Merged

Conversation

DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented Apr 14, 2023

Rework our implementation of tarantool.Datetime class. Previously it had relied on pandas.Timestamp and pandas.Timedelta. There were user complaints about pandas as a requirement since it's rather heavy. Now our implementation of datetime uses built-in datetime.datetime, datetime.timedelta and some other built-in tools.

It is expected that the implementation change wouldn't affect users, but some minor behavior traits were broken in this patch:

  • Now we rely on datetime argument validation which differs from the pandas one. For example, it doesn't allow overflows for fields. Exceptions that user may receive from internal datetime are, of course, had changed as well.
  • We drop the support of __eq__ for pandas.Timestamp. We simply compared underlying pandas.Timestamp with argument one, and now it's impossible. If the feature would be useful later, we may implement the comparison in some compatible way.
  • __repr__ has been changed since internal representation has been changed as well.

Closes #290

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-290-custom-datetime branch 5 times, most recently from 606bd08 to 96c72d6 Compare April 14, 2023 15:25
@DifferentialOrange DifferentialOrange marked this pull request as ready for review April 14, 2023 16:58
Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

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

Thank you for the patch!

Rework our implementation of tarantool.Datetime class. Previously it had
relied on pandas.Timestamp and pandas.Timedelta. There were user
complaints about pandas as a requirement since it's rather heavy. Now
our implementation of datetime uses built-in datetime.datetime,
datetime.timedelta and other built-in tools.

It is expected that the implementation change wouldn't affect users, but
some minor behavior traits were broken in this patch:
- Now we rely on datetime argument validation which if differs from
  pandas one. For example, it doesn't allow overflows for fields.
  Exceptions that user may receive from internal datetime are, of
  course, had changed as well.
- We drop the support of `__eq__` for pandas.Timestamp. We simply
  compared underlying pandas.Timestamp with argument one, and now it's
  impossible. If the feature would be required later, we may implement
  its comparison in some compatible way.
- `__repr__` has been changed since internal representation has been
  changed as well.

Closes #290
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/gh-290-custom-datetime branch from 96c72d6 to 5215d42 Compare April 17, 2023 08:43
@DifferentialOrange DifferentialOrange merged commit 3f7a145 into master Apr 17, 2023
@DifferentialOrange DifferentialOrange deleted the DifferentialOrange/gh-290-custom-datetime branch April 17, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make pandas dependency optional
2 participants