René's URL Explorer Experiment


Title: No support for null UnixTimestamp · Issue #2803 · feast-dev/feast · GitHub

Open Graph Title: No support for null UnixTimestamp · Issue #2803 · feast-dev/feast

X Title: No support for null UnixTimestamp · Issue #2803 · feast-dev/feast

Description: Expected Behavior This script should return online features, with one null in last_purchased_date from feast import Entity, FeatureView from feast.infra.offline_stores.file_source import FileSource from feast.repo_config import RegistryC...

Open Graph Description: Expected Behavior This script should return online features, with one null in last_purchased_date from feast import Entity, FeatureView from feast.infra.offline_stores.file_source import FileSource...

X Description: Expected Behavior This script should return online features, with one null in last_purchased_date from feast import Entity, FeatureView from feast.infra.offline_stores.file_source import FileSource...

Opengraph URL: https://github.com/feast-dev/feast/issues/2803

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"No support for null UnixTimestamp","articleBody":"## Expected Behavior \r\n\r\nThis script should return online features, with one null in `last_purchased_date`\r\n```python\r\nfrom feast import Entity, FeatureView\r\nfrom feast.infra.offline_stores.file_source import FileSource\r\nfrom feast.repo_config import RegistryConfig, RepoConfig\r\nfrom feast import FeatureStore\r\nfrom datetime import datetime\r\nfrom feast.types import Int32, UnixTimestamp\r\nfrom feast import Field\r\n\r\nimport pandas as pd\r\n\r\n\r\n# create dataset\r\npd.DataFrame([\r\n    {\"user_id\": 1, \"event_timestamp\": datetime(2022, 5, 1), \"created\": datetime(2022, 5, 1), \"purchases\": 3, \"last_purchase_date\": datetime(2022, 4, 23, 13, 4, 1)},\r\n    {\"user_id\": 2, \"event_timestamp\": datetime(2022, 5, 2), \"created\": datetime(2022, 5, 2), \"purchases\": 1, \"last_purchase_date\": datetime(2022, 2, 1, 11, 4, 1)},\r\n    {\"user_id\": 3, \"event_timestamp\": datetime(2022, 5, 2), \"created\": datetime(2022, 5, 2), \"purchases\": 0, \"last_purchase_date\": None},    \r\n]).to_parquet('user_stats.parquet')\r\n\r\n\r\nuser = Entity(name=\"user_id\", description=\"user id\")\r\n\r\nuser_stats_view = FeatureView(\r\n    name=\"user_stats\",\r\n    entities=[user],\r\n    source=FileSource(\r\n        path=\"user_stats.parquet\",\r\n        timestamp_field=\"event_timestamp\",\r\n        created_timestamp_column=\"created\",\r\n    ),\r\n    schema=[\r\n        Field(name=\"purchases\", dtype=Int32),\r\n        Field(name=\"last_purchase_date\", dtype=UnixTimestamp),\r\n    ]\r\n)\r\n\r\nonline_store_path = 'online_store.db'\r\nregistry_path = 'registry.db'\r\n\r\nrepo = RepoConfig(\r\n    registry=\"registry.db\",\r\n    project='feature_store',\r\n    provider=\"local\",\r\n    offline_store=\"file\",\r\n    use_ssl=True, \r\n    is_secure=True,\r\n    validate=True,\r\n)\r\n\r\nfs = FeatureStore(config=repo)\r\n\r\nfs.apply([user, user_stats_view])\r\n\r\nfs.materialize_incremental(end_date=datetime.utcnow())\r\n\r\n\r\nentity_rows = [{\"user_id\": i} for i in range(1, 4)]\r\n\r\n\r\nfeature_df = fs.get_online_features(\r\n    features=[\r\n        \"user_stats:purchases\",\r\n        \"user_stats:last_purchase_date\",\r\n    ],\r\n    entity_rows=entity_rows\r\n).to_df()\r\nprint(feature_df)\r\n```\r\n\r\n## Current Behavior\r\n\r\n```\r\nMaterializing 1 feature views to 2022-06-16 20:30:41-06:00 into the sqlite online store.\r\n\r\nSince the ttl is 0 for feature view user_stats, the start date will be set to 1 year before the current time.\r\nuser_stats from 2021-06-17 20:30:41-06:00 to 2022-06-16 20:30:41-06:00:\r\n100%|████████████████████████████████████████████████████████████████| 3/3 [00:00\u003c00:00, 420.36it/s]\r\nTraceback (most recent call last):\r\n  File \"null_timestamp_example.py\", line 59, in \u003cmodule\u003e\r\n    feature_df = fs.get_online_features(\r\n  File \"/Users/apope/feast/sdk/python/feast/online_response.py\", line 79, in to_df\r\n    return pd.DataFrame(self.to_dict(include_event_timestamps))\r\n  File \"/Users/apope/feast/sdk/python/feast/online_response.py\", line 59, in to_dict\r\n    response[feature_ref] = [\r\n  File \"/Users/apope/feast/sdk/python/feast/online_response.py\", line 60, in \u003clistcomp\u003e\r\n    feast_value_type_to_python_type(v) for v in feature_vector.values\r\n  File \"/Users/apope/feast/sdk/python/feast/type_map.py\", line 74, in feast_value_type_to_python_type\r\n    val = datetime.fromtimestamp(val, tz=timezone.utc)\r\nOSError: [Errno 84] Value too large to be stored in data type\r\n```\r\n\r\n## Steps to reproduce\r\n\r\n### Specifications\r\n\r\n- Version: 0.21.2\r\n- Platform: Mac\r\n- Subsystem: \r\n\r\n## Possible Solution\r\n\r\nThis happens because, while materializing, in `_python_datetime_to_int_timestamp()` the `NaT` value gets converted to `-9223372036854775808`\r\n\r\n```python\r\nIn [108]:\r\nfrom typing import cast, Sequence\r\nimport numpy as np\r\n\r\ncast(Sequence[np.int_], np.array(['nat'], dtype='datetime64[ns]').astype('datetime64[s]').astype(np.int_))\r\nOut [108]:\r\narray([-9223372036854775808])\r\n```\r\n\r\nWhich is out of range for `datetime.fromtimestamp()`:\r\n```python\r\nIn [109]:\r\nfrom datetime import datetime, timezone\r\n\r\ndatetime.fromtimestamp(-9223372036854775808, tz=timezone.utc)\r\n\r\nTruncated Traceback (Use C-c C-$ to view full TB):\r\n/tmp/ipykernel_58/1143168205.py in \u003cmodule\u003e\r\n      1 from datetime import datetime, timezone\r\n      2 \r\n----\u003e 3 val = datetime.fromtimestamp(-9223372036854775808, tz=timezone.utc)\r\n\r\nOSError: [Errno 75] Value too large for defined data type\r\n```\r\n\r\nA simple fix would be to leave the materialization logic as-is and, when deserializing in `feast_value_type_to_python_type()`, just catch this one value and return a null instead.","author":{"url":"https://github.com/aapope","@type":"Person","name":"aapope"},"datePublished":"2022-06-16T21:14:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2803/feast/issues/2803"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d6f19343-92bd-1535-14d9-bce452296b55
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8ECE:3A860B:54BDED:7801AB:6978B825
html-safe-nonce2ac376b2668d93aa724b7b4e0c2ded5601f6011fb0735f5744177a7b5b676be4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUNFOjNBODYwQjo1NEJERUQ6NzgwMUFCOjY5NzhCODI1IiwidmlzaXRvcl9pZCI6IjIzOTI5ODc0MDc3OTI3ODEzNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd8e71225c9c7170a57f74bc94b989733892901de5cab1e99f65638b19df76425
hovercard-subject-tagissue:1274088444
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/2803/issue_layout
twitter:imagehttps://opengraph.githubassets.com/dc478a25baf9b9b34693e873e92094354db0cd046af972c451215a3dfa100ced/feast-dev/feast/issues/2803
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/dc478a25baf9b9b34693e873e92094354db0cd046af972c451215a3dfa100ced/feast-dev/feast/issues/2803
og:image:altExpected Behavior This script should return online features, with one null in last_purchased_date from feast import Entity, FeatureView from feast.infra.offline_stores.file_source import FileSource...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaapope
hostnamegithub.com
expected-hostnamegithub.com
None8fe1bd499c6d7cea4c6a731e1024678b67678c64baac66af24f17b565ee0651e
turbo-cache-controlno-preview
go-importgithub.com/feast-dev/feast git https://github.com/feast-dev/feast.git
octolytics-dimension-user_id57027613
octolytics-dimension-user_loginfeast-dev
octolytics-dimension-repository_id161133770
octolytics-dimension-repository_nwofeast-dev/feast
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id161133770
octolytics-dimension-repository_network_root_nwofeast-dev/feast
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release54838e42b488f7a96e473ea27343ed90b6d97959
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/feast-dev/feast/issues/2803#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fissues%2F2803
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fissues%2F2803
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=feast-dev%2Ffeast
Reloadhttps://github.com/feast-dev/feast/issues/2803
Reloadhttps://github.com/feast-dev/feast/issues/2803
Reloadhttps://github.com/feast-dev/feast/issues/2803
feast-dev https://github.com/feast-dev
feasthttps://github.com/feast-dev/feast
Notifications https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Fork 1.2k https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Star 6.7k https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Code https://github.com/feast-dev/feast
Issues 182 https://github.com/feast-dev/feast/issues
Pull requests 67 https://github.com/feast-dev/feast/pulls
Discussions https://github.com/feast-dev/feast/discussions
Actions https://github.com/feast-dev/feast/actions
Security 0 https://github.com/feast-dev/feast/security
Insights https://github.com/feast-dev/feast/pulse
Code https://github.com/feast-dev/feast
Issues https://github.com/feast-dev/feast/issues
Pull requests https://github.com/feast-dev/feast/pulls
Discussions https://github.com/feast-dev/feast/discussions
Actions https://github.com/feast-dev/feast/actions
Security https://github.com/feast-dev/feast/security
Insights https://github.com/feast-dev/feast/pulse
New issuehttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/2803
New issuehttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/2803
No support for null UnixTimestamphttps://github.com/feast-dev/feast/issues/2803#top
Community Contribution NeededWe want community to contributehttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22Community%20Contribution%20Needed%22
good first issueGood for newcomershttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
kind/bughttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/p2https://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22priority%2Fp2%22
https://github.com/aapope
https://github.com/aapope
aapopehttps://github.com/aapope
on Jun 16, 2022https://github.com/feast-dev/feast/issues/2803#issue-1274088444
Community Contribution NeededWe want community to contributehttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22Community%20Contribution%20Needed%22
good first issueGood for newcomershttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22good%20first%20issue%22
kind/bughttps://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22
priority/p2https://github.com/feast-dev/feast/issues?q=state%3Aopen%20label%3A%22priority%2Fp2%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.