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

[BUG] Dates in DataTables appear as zero-epoch #10769

Closed
lyijin opened this issue Dec 7, 2020 · 1 comment · Fixed by #10770
Closed

[BUG] Dates in DataTables appear as zero-epoch #10769

lyijin opened this issue Dec 7, 2020 · 1 comment · Fixed by #10770

Comments

@lyijin
Copy link

lyijin commented Dec 7, 2020

As requested by @bryevdv on issue #10749.

Dates in DataTables all appear as zero epoch (1970-01-01), despite them actually having valid dates in those table cells. Best illustrated by the DataTable section in the official widget documentation
https://docs.bokeh.org/en/latest/docs/user_guide/interaction/widgets.html
(I hope this skips the need for a minimal repro code :D)

Copy-pasting the values out of the table DOES produce valid dates, so it's just the appearance that is faulty.

Screenie to illustrate fault:
image

Cheers!

@lyijin lyijin added the TRIAGE label Dec 7, 2020
@lyijin lyijin changed the title [BUG] Dates in DataTables appears as zero-epoch [BUG] Dates in DataTables appear as zero-epoch Dec 7, 2020
@mattpap mattpap added this to the 2.3 milestone Dec 7, 2020
@bryevdv bryevdv modified the milestones: 2.3, next Jan 6, 2021
@Suicoleiro
Copy link
Contributor

Hi all,

The official bokeh documentation example works correctly if you put the "dates" source into a numpy array instead of a list. The two ways I tested and give correct results are:

  1. Converting list into numpy array
data = dict(
        dates=np.array([date(2014, 3, i+1) for i in range(10)]),
        downloads=[randint(0, 100) for i in range(10)],
    )
  1. Converting the data dict into a pandas dataframe (same effect, list is being converted to numpy array)
data = dict(
        dates=[date(2014, 3, i+1) for i in range(10)],
        downloads=[randint(0, 100) for i in range(10)],
    )
df = pd.DataFrame(data)

@mattpap @bryevdv checking with you if this is related to a more general issue between list vs. array or if it is an isolated event for the DateFormatter class before going into more details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants