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

Number fields with "time" in name incorrectly parsed as timestamps #29124

Open
AI091 opened this issue Feb 24, 2025 · 1 comment
Open

Number fields with "time" in name incorrectly parsed as timestamps #29124

AI091 opened this issue Feb 24, 2025 · 1 comment
Labels
bug Something isn't working right feature/data-management Feature Tag: Data management (fka Taxonomy) team/product-analytics

Comments

@AI091
Copy link

AI091 commented Feb 24, 2025

Bug description

Number fields interpreted as dates. I have an event where it contains an entry called parsing_time_in_seconds. It's a number as shown in the screenshot. However it doesn't appear in trends selection in number choices and upon using hogql queries on it it is converted to a timestamp, the only way I found around it is by using JSONExtractFloat method to force parse it as a number, but that means I can't use it nicely in dashboards.
I am assuming having the word time in the property somehow makes it auto-parse to time_stamp, is this the intended behavior?

Image

Image

link on Posthog Cloud for the query:https://eu.posthog.com/project/32299/insights/V05z1kHc/

How to reproduce

  1. Create event with numeric property containing word time
  2. See that property is auto intepreted as timestamp and is unsable in trends as a number.

Debug info

- [x] PostHog Cloud, Debug information: Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/0195375c-6e4a-7a51-874b-fb216c51cb13?t=6368
Admin: http://go/adminOrgEU/0191e5ad-b2a6-0000-986b-d89fef3ca53f (project ID 32300)
Sentry: http://go/sentryEU/32300(https://posthog.com/blog/sunsetting-helm-support-posthog)),
@AI091 AI091 added the bug Something isn't working right label Feb 24, 2025
@ordehi
Copy link

ordehi commented Feb 25, 2025

Thanks for the report! You can change the property's data type to numeric under data management and that should fix the query.

Image

Image

I tested this and it's indeed treating anything with "time" in the name as a datetime, at least for insights purposes, even though in the event it's treated as a number:

Image

Image

@ordehi ordehi added feature/data-management Feature Tag: Data management (fka Taxonomy) team/product-analytics labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right feature/data-management Feature Tag: Data management (fka Taxonomy) team/product-analytics
Projects
None yet
Development

No branches or pull requests

2 participants