René's URL Explorer Experiment


Title: Bytewax materialization engine fails when loading feature_store.yaml · Issue #3893 · feast-dev/feast · GitHub

Open Graph Title: Bytewax materialization engine fails when loading feature_store.yaml · Issue #3893 · feast-dev/feast

X Title: Bytewax materialization engine fails when loading feature_store.yaml · Issue #3893 · feast-dev/feast

Description: Expected Behavior Loading the feature_store.yaml file from within a Bytewax pod should work. Current Behavior yaml.safe_load() raises an error while trying to reconstruct the object below: pathlib.PosixPath The error occurs while running...

Open Graph Description: Expected Behavior Loading the feature_store.yaml file from within a Bytewax pod should work. Current Behavior yaml.safe_load() raises an error while trying to reconstruct the object below: pathlib....

X Description: Expected Behavior Loading the feature_store.yaml file from within a Bytewax pod should work. Current Behavior yaml.safe_load() raises an error while trying to reconstruct the object below: pathlib....

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bytewax materialization engine fails when loading feature_store.yaml","articleBody":"## Expected Behavior \r\n\r\nLoading the `feature_store.yaml` file from within a Bytewax pod should work.\r\n\r\n## Current Behavior\r\n\r\n`yaml.safe_load()` raises an error while trying to reconstruct the object below:\r\n\r\n- pathlib.PosixPath\r\n\r\nThe error occurs while running materialization using Bytewax at the point where the `feature_store.yaml` is loaded. The code where this happens is in [sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py](https://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py#L14). Below is an excerpt:\r\n\r\n```python\r\n# ...\r\n with open(\"/var/feast/feature_store.yaml\") as f:\r\n        feast_config = yaml.safe_load(f) # \u003c---- yaml.safe_load() fails\r\n# ...\r\n```\r\n\r\nThe exact message is as below:\r\n\r\n```python\r\nDefaulted container \"process\" out of: process, init-hostfile (init)\r\nFeast is an open source project that collects anonymized error reporting and usage statistics. To opt out or learn more see https://docs.feast.dev/reference/usage\r\nTraceback (most recent call last):\r\n  File \"/bytewax/dataflow.py\", line 15, in \u003cmodule\u003e\r\n    feast_config = yaml.safe_load(f)\r\n  File \"/usr/local/lib/python3.9/site-packages/yaml/__init__.py\", line 125, in safe_load\r\n    return load(stream, SafeLoader)\r\n  File \"/usr/local/lib/python3.9/site-packages/yaml/__init__.py\", line 81, in load\r\n    return loader.get_single_data()\r\n  File \"/usr/local/lib/python3.9/site-packages/yaml/constructor.py\", line 51, in get_single_data\r\n    return self.construct_document(node)\r\n  File \"/usr/local/lib/python3.9/site-packages/yaml/constructor.py\", line 60, in construct_document\r\n    for dummy in generator:\r\n  File \"/usr/local/lib/python3.9/site-packages/yaml/constructor.py\", line 413, in construct_yaml_map\r\n    value = self.construct_mapping(node)\r\n  File \"/usr/local/lib/python3.9/site-packages/yaml/constructor.py\", line 218, in construct_mapping\r\n    return super().construct_mapping(node, deep=deep)\r\n  File \"/usr/local/lib/python3.9/site-packages/yaml/constructor.py\", line 143, in construct_mapping\r\n    value = self.construct_object(value_node, deep=deep)\r\n  File \"/usr/local/lib/python3.9/site-packages/yaml/constructor.py\", line 100, in construct_object\r\n    data = constructor(self, node)\r\n  File \"/usr/local/lib/python3.9/site-packages/yaml/constructor.py\", line 427, in construct_undefined\r\n    raise ConstructorError(None, None,\r\nyaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:python/object/apply:pathlib.PosixPath'\r\n  in \"/var/feast/feature_store.yaml\", line 119, column 12\r\n```\r\n\r\nInterestingly, method [_create_configuration_map()](https://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_engine.py#L312) of class `BytewaxMaterializationEngine` uses `yaml.dump()` instead of `yaml.safe_dump()` to write the config in the first place:\r\n\r\n```python\r\n    # ...\r\n    def _create_configuration_map(self, job_id, paths, feature_view, namespace):\r\n        \"\"\"Create a Kubernetes configmap for this job\"\"\"\r\n\r\n        feature_store_configuration = yaml.dump(self.repo_config.dict())\r\n    # ...\r\n```\r\n\r\nWhen I tried to replace `yaml.dump` by `yaml.safe_dump()` I got the following error:\r\n\r\n```python\r\nyaml.representer.RepresenterError: ('cannot represent an object', \u003cRedisType.redis: 'redis'\u003e)\r\n```\r\n\r\nIt appears that `yaml.SafeDumper` and `yaml.SafeLoader` cannot find  the appropriate representers and/or constructors for `RedisType.redis` and `path.PosixPath`. Perhaps those objects do not have corresponding `to_yaml()` and `from_yaml()` methods.\r\n\r\n## Steps to reproduce\r\n\r\nRun the materialization:\r\n\r\n```bash \r\nfeast materialize  --views \"EXAMPLE_FEATURE_VIEW\" '2023-10-30T00:00:00' '2023-10-30T23:59:59'\r\n```\r\n\r\nGive it some time and check the pods:\r\n\r\n```bash\r\nkubectl get pods -n bytewax\r\nNAME                                                    READY   STATUS   RESTARTS   AGE\r\ndataflow-4f3a7567-7cc9-4188-9fb1-cfc614451c35-0-9kxgt   0/1     Error    0          25s\r\ndataflow-4f3a7567-7cc9-4188-9fb1-cfc614451c35-1-d8n4r   0/1     Error    0          25s\r\ndataflow-4f3a7567-7cc9-4188-9fb1-cfc614451c35-2-wmmsd   0/1     Error    0          25s\r\ndataflow-4f3a7567-7cc9-4188-9fb1-cfc614451c35-3-c8gn7   0/1     Error    0          25s\r\ndataflow-4f3a7567-7cc9-4188-9fb1-cfc614451c35-4-hgfbn   0/1     Error    0          25s\r\n```\r\n\r\nThen upon inspecting the logs, I see the error from above:\r\n\r\n```bash\r\nkubectl logs -n bytewax dataflow-4f3a7567-7cc9-4188-9fb1-cfc614451c35-4-hgfbn\r\n```\r\n\r\n### Specifications\r\n\r\n- Version: feast==0.35.0, [pyyaml==6.0.1](https://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/requirements/py3.10-ci-requirements.txt#L714), [bytewax==0.15.1](https://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/requirements/py3.10-ci-requirements.txt#L75)\r\n- Platform:\r\n    - local: MacOS\r\n    - bytewax image: a custom build based on the Dockerfile from the feast-dev repo [sdk/python/feast/infra/materialization/contrib/bytewax/Dockerfile](https://github.com/feast-dev/feast/blob/9237361e8d87b8e5dc02dffa74905eab2380fbd7/sdk/python/feast/infra/materialization/contrib/bytewax/Dockerfile#L28) where feast is installed with support for AWS, Bytewax, Redis (as the online store), Postgres (as the SQL registry)\r\n\r\n## Possible Solution\r\n\r\nI was able to make it work by modifying [sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py](https://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py#L14) to use [yaml.load()](https://github.com/yaml/pyyaml/issues/266#issuecomment-472899408) instead of `yaml.safe_load()` and rebuilding the [Bytewax docker image](https://github.com/feast-dev/feast/blob/9237361e8d87b8e5dc02dffa74905eab2380fbd7/sdk/python/feast/infra/materialization/contrib/bytewax/Dockerfile#L28):\r\n\r\n```python\r\n    with open(\"/var/feast/feature_store.yaml\") as f:\r\n        #feast_config = yaml.safe_load(f)\r\n        feast_config = yaml.load(f, Loader=yaml.Loader)\r\n\r\n        with open(\"/var/feast/bytewax_materialization_config.yaml\") as b:\r\n            # I did not test if yaml.safe_load() works for the bytewax config, but just went ahead and replaced it too \r\n            #bytewax_config = yaml.safe_load(b)\r\n            bytewax_config = yaml.load(b, Loader=yaml.Loader)\r\n```","author":{"url":"https://github.com/gterziysky","@type":"Person","name":"gterziysky"},"datePublished":"2024-01-18T17:20:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3893/feast/issues/3893"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3d7e8522-c199-48be-df63-e3793ca0e7a4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD47E:3EA4FC:210FB1D:2DB9EE7:69728E6F
html-safe-nonce37d242283859db7482909afe0316e4290da5f669241e8d94849438e6d085f567
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDdFOjNFQTRGQzoyMTBGQjFEOjJEQjlFRTc6Njk3MjhFNkYiLCJ2aXNpdG9yX2lkIjoiNDE0MDUzMjE0OTM4OTUyODY4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac954e914f4a393f02db5df0a89bfe1233ffa6d04050149d739dfb4c142b172967
hovercard-subject-tagissue:2088736352
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/3893/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e011f591210e9f27866298cbaa0e65c67a4b744bdaee136e9f750eb774e9337d/feast-dev/feast/issues/3893
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e011f591210e9f27866298cbaa0e65c67a4b744bdaee136e9f750eb774e9337d/feast-dev/feast/issues/3893
og:image:altExpected Behavior Loading the feature_store.yaml file from within a Bytewax pod should work. Current Behavior yaml.safe_load() raises an error while trying to reconstruct the object below: pathlib....
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegterziysky
hostnamegithub.com
expected-hostnamegithub.com
Nonef55b89ef71fda443a25c469605964fe31f4313158c4238f900f8894d6f31ffa4
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
release69ed002f93fb5a101bb3ef79e8704a63acc02bd2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/feast-dev/feast/issues/3893#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffeast-dev%2Ffeast%2Fissues%2F3893
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%2F3893
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/3893
Reloadhttps://github.com/feast-dev/feast/issues/3893
Reloadhttps://github.com/feast-dev/feast/issues/3893
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.6k https://github.com/login?return_to=%2Ffeast-dev%2Ffeast
Code https://github.com/feast-dev/feast
Issues 181 https://github.com/feast-dev/feast/issues
Pull requests 64 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/3893
New issuehttps://github.com/login?return_to=https://github.com/feast-dev/feast/issues/3893
#3912https://github.com/feast-dev/feast/pull/3912
Bytewax materialization engine fails when loading feature_store.yamlhttps://github.com/feast-dev/feast/issues/3893#top
#3912https://github.com/feast-dev/feast/pull/3912
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/gterziysky
https://github.com/gterziysky
gterziyskyhttps://github.com/gterziysky
on Jan 18, 2024https://github.com/feast-dev/feast/issues/3893#issue-2088736352
sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.pyhttps://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py#L14
_create_configuration_map()https://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_engine.py#L312
pyyaml==6.0.1https://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/requirements/py3.10-ci-requirements.txt#L714
bytewax==0.15.1https://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/requirements/py3.10-ci-requirements.txt#L75
sdk/python/feast/infra/materialization/contrib/bytewax/Dockerfilehttps://github.com/feast-dev/feast/blob/9237361e8d87b8e5dc02dffa74905eab2380fbd7/sdk/python/feast/infra/materialization/contrib/bytewax/Dockerfile#L28
sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.pyhttps://github.com/feast-dev/feast/blob/ac6529c380bc623a15054350c9936b69617b4bee/sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py#L14
yaml.load()https://github.com/yaml/pyyaml/issues/266#issuecomment-472899408
Bytewax docker imagehttps://github.com/feast-dev/feast/blob/9237361e8d87b8e5dc02dffa74905eab2380fbd7/sdk/python/feast/infra/materialization/contrib/bytewax/Dockerfile#L28
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.