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

Python driver drops milliseconds from timestamps #3439

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

Python driver drops milliseconds from timestamps #3439

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working Client interfaces major

Comments

@monetdb-team
Copy link

Date: 2014-02-18 17:37:28 +0100
From: Alex Shestakov <<shura.shestakov>>
To: clients devs <>
Version: 11.17.9 (Jan2014)
CC: shura.shestakov

Last updated: 2014-05-22 09:52:20 +0200

Comment 19586

Date: 2014-02-18 17:37:28 +0100
From: Alex Shestakov <<shura.shestakov>>

Created attachment 266
fix_milliseconds

Python driver drops milliseconds from temporal data when reading from the database.

The attached patch fixes the problem for me.

Attached file: monetdb_python.patch (application/octet-stream, 2537 bytes)
Description: fix_milliseconds

Comment 19771

Date: 2014-04-24 17:09:47 +0200
From: MonetDB Mercurial Repository <>

Changeset f2bbeac41f80 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=f2bbeac41f80

Changeset description:

Keep second fraction in Python driver.
This fixes bug #3439, albeit in a different way than the patch in the
bug report.

Comment 19772

Date: 2014-04-24 17:17:26 +0200
From: MonetDB Mercurial Repository <>

Changeset a1c694f27eeb made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=a1c694f27eeb

Changeset description:

Added test for bug #3439, fixed typo in fix for same.

Comment 19774

Date: 2014-04-24 18:45:06 +0200
From: Alex Shestakov <<shura.shestakov>>

The original patch also fixed a bug with parsing timestamps having negative timezone offsets (in _extract_timezone() function).

The new fix doesn't do it.

Also in the original patch I replaced python parsing code using string.split() with datettime.strptime() assuming that it will work significantly faster.

Comment 19775

Date: 2014-04-24 19:25:37 +0200
From: @sjoerdmullender

(In reply to comment 3)

The original patch also fixed a bug with parsing timestamps having negative
timezone offsets (in _extract_timezone() function).

Now also fixed.

The new fix doesn't do it.

Also in the original patch I replaced python parsing code using
string.split() with datettime.strptime() assuming that it will work
significantly faster.

I'll need to look into that claim.

Comment 19778

Date: 2014-04-24 22:10:34 +0200
From: MonetDB Mercurial Repository <>

Changeset 4bd5465d5ced made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=4bd5465d5ced

Changeset description:

Redid fix for bug #3439, much more like attached patch.
The patch wasn't entirely correct (times don't have fractions), and
not complete (also did date in the same way).
The advantage of this patch is that it actually simplifies the code,
something I didn't appreciate earlier.
The (slight) disadvantage is that it expects the format of the time
zone to be exactly [+-]HH:MM, unlike the original which was slightly
more liberal (in intent, anyway -- there was a bug in it) but I guess
that's OK.
@monetdb-team monetdb-team added bug Something isn't working Client interfaces major labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Client interfaces major
Projects
None yet
Development

No branches or pull requests

2 participants