Code Monkey home page Code Monkey logo

Comments (5)

AdrianTeng avatar AdrianTeng commented on August 15, 2024

Hi Bryant, this does look like timezone issue.

The as_of column is timezone aware:

        local_tz = mktz()
        if not as_of:
            as_of = dt.now()
        if as_of.tzinfo is None:
            as_of = as_of.replace(tzinfo=local_tz)

If mktz() and dt.now() is reporting inconsistent data (say, dt.now() gives Boston time and mktz() gives London timezone) this would explain the broken test. Would you mind confirming those two functions' output on your machine?

from arctic.

bmoscon avatar bmoscon commented on August 15, 2024
    from arctic.date import mktz 
    mktz()
    tzfile('/usr/share/zoneinfo/America/New_York')
    import datetime
    datetime.datetime.now()
    datetime.datetime(2015, 12, 19, 8, 19, 45, 540301)
    datetime.datetime.now().tzinfo is None
    True

the unit tests clearly expect that the timezone is london/GMT. It looks like the code you shared above will force everything to the local tz since datetime.now seems to give something without a timezone

from arctic.

AdrianTeng avatar AdrianTeng commented on August 15, 2024

Right so we have two problems here.

  • The RHS of the assert statement should have local tz info
  • (!) Multi-datetime-index df loses timezone info after write->read

Will look into a fix

from arctic.

bmoscon avatar bmoscon commented on August 15, 2024

Is there a reason we don't just store everything at UTC and apply a timezone later?

from arctic.

AdrianTeng avatar AdrianTeng commented on August 15, 2024

It does! It's just the codepath not supporting multi-index fully (yet)

from arctic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.