René's URL Explorer Experiment


Title: Pydantic, exclude_defaults=True re-add `apiVersion` and `kind` by haarchri · Pull Request #114 · crossplane/function-sdk-python · GitHub

Open Graph Title: Pydantic, exclude_defaults=True re-add `apiVersion` and `kind` by haarchri · Pull Request #114 · crossplane/function-sdk-python

X Title: Pydantic, exclude_defaults=True re-add `apiVersion` and `kind` by haarchri · Pull Request #114 · crossplane/function-sdk-python

Description: Description of your changes In Pydantic, exclude_defaults=True in model_dump excludes fields that have their value equal to the default. If a field like apiVersion is set to its default value 's3.aws.upbound.io/v1beta2' (and not explicitly provided during initialization), it will be excluded from the serialized output. so we will explicit add apiVersion and kind Fixes # I have: Read and followed Crossplane's contribution process. Added or updated unit tests for my change. Tests tested via dependencies = [ "click==8.1.7", "grpcio==1.66.2", "crossplane-function-sdk-python @ git+https://github.com/haarchri/function-sdk-python@test" ] [tool.hatch.metadata] allow-direct-references = true before: up composition render apis/xstoragebuckets/composition.yaml examples/storagebucket/example.yaml --- apiVersion: platform.example.com/v1alpha1 kind: XStorageBucket metadata: name: example status: conditions: - lastTransitionTime: "2024-01-01T00:00:00Z" message: 'Unready resources: bucket' reason: Creating status: "False" type: Ready --- metadata: annotations: crossplane.io/composition-resource-name: bucket generateName: example- labels: crossplane.io/composite: example ownerReferences: - apiVersion: platform.example.com/v1alpha1 blockOwnerDeletion: true controller: true kind: XStorageBucket name: example uid: "" spec: forProvider: region: us-west-1 — with this PR: up composition render apis/xstoragebuckets/composition.yaml examples/storagebucket/example.yaml --- apiVersion: platform.example.com/v1alpha1 kind: XStorageBucket metadata: name: example status: conditions: - lastTransitionTime: "2024-01-01T00:00:00Z" message: 'Unready resources: bucket' reason: Creating status: "False" type: Ready --- apiVersion: s3.aws.upbound.io/v1beta1 kind: Bucket metadata: annotations: crossplane.io/composition-resource-name: bucket generateName: example- labels: crossplane.io/composite: example ownerReferences: - apiVersion: platform.example.com/v1alpha1 blockOwnerDeletion: true controller: true kind: XStorageBucket name: example uid: "" spec: forProvider: region: us-west-1

Open Graph Description: Description of your changes In Pydantic, exclude_defaults=True in model_dump excludes fields that have their value equal to the default. If a field like apiVersion is set to its default value '...

X Description: Description of your changes In Pydantic, exclude_defaults=True in model_dump excludes fields that have their value equal to the default. If a field like apiVersion is set to its default value &...

Opengraph URL: https://github.com/crossplane/function-sdk-python/pull/114

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0025efaa-b2ee-0ffb-0c5d-f7e9ae61aa5a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA640:15CAB5:3885BE:4C7DBA:6A613839
html-safe-nonce36b9dc386392cad317faa97a3a45653bb7c7276740b21ccd3b9d903d771e9785
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjQwOjE1Q0FCNTozODg1QkU6NEM3REJBOjZBNjEzODM5IiwidmlzaXRvcl9pZCI6IjQ3NzY3NTY2NzE1NTI3NjM5NjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf6f1a12fedc418fd38dce372aeea9de884f8e11afa5840b8cbce27eddd4eb387
hovercard-subject-tagpull_request:2262232478
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/crossplane/function-sdk-python/pull/114/files
twitter:imagehttps://avatars.githubusercontent.com/u/21083497?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/21083497?s=400&v=4
og:image:altDescription of your changes In Pydantic, exclude_defaults=True in model_dump excludes fields that have their value equal to the default. If a field like apiVersion is set to its default value '...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2b7a3d1e6770dc7153450d820fcfe9a7851c4cf2251dcc29c7ad3c5cd1b9e88b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/crossplane/function-sdk-python git https://github.com/crossplane/function-sdk-python.git
octolytics-dimension-user_id45158470
octolytics-dimension-user_logincrossplane
octolytics-dimension-repository_id721365259
octolytics-dimension-repository_nwocrossplane/function-sdk-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id721365259
octolytics-dimension-repository_network_root_nwocrossplane/function-sdk-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release78cf9d43f120d1f03636ca22ab420bcbb1712804
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/crossplane/function-sdk-python/pull/114/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcrossplane%2Ffunction-sdk-python%2Fpull%2F114%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2Fcrossplane%2Ffunction-sdk-python%2Fpull%2F114%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=crossplane%2Ffunction-sdk-python
Reloadhttps://github.com/crossplane/function-sdk-python/pull/114/files
Reloadhttps://github.com/crossplane/function-sdk-python/pull/114/files
Reloadhttps://github.com/crossplane/function-sdk-python/pull/114/files
Please reload this pagehttps://github.com/crossplane/function-sdk-python/pull/114/files
crossplane https://github.com/crossplane
function-sdk-pythonhttps://github.com/crossplane/function-sdk-python
Notifications https://github.com/login?return_to=%2Fcrossplane%2Ffunction-sdk-python
Fork 14 https://github.com/login?return_to=%2Fcrossplane%2Ffunction-sdk-python
Star 13 https://github.com/login?return_to=%2Fcrossplane%2Ffunction-sdk-python
Code https://github.com/crossplane/function-sdk-python
Issues 6 https://github.com/crossplane/function-sdk-python/issues
Pull requests 1 https://github.com/crossplane/function-sdk-python/pulls
Actions https://github.com/crossplane/function-sdk-python/actions
Projects https://github.com/crossplane/function-sdk-python/projects
Security and quality 0 https://github.com/crossplane/function-sdk-python/security
Insights https://github.com/crossplane/function-sdk-python/pulse
Code https://github.com/crossplane/function-sdk-python
Issues https://github.com/crossplane/function-sdk-python/issues
Pull requests https://github.com/crossplane/function-sdk-python/pulls
Actions https://github.com/crossplane/function-sdk-python/actions
Projects https://github.com/crossplane/function-sdk-python/projects
Security and quality https://github.com/crossplane/function-sdk-python/security
Insights https://github.com/crossplane/function-sdk-python/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fcrossplane%2Ffunction-sdk-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcrossplane%2Ffunction-sdk-python%2Fissues%2Fnew%2Fchoose
negzhttps://github.com/negz
crossplane:mainhttps://github.com/crossplane/function-sdk-python/tree/main
haarchri:testhttps://github.com/haarchri/function-sdk-python/tree/test
Conversation 5 https://github.com/crossplane/function-sdk-python/pull/114
Commits 1 https://github.com/crossplane/function-sdk-python/pull/114/commits
Checks 0 https://github.com/crossplane/function-sdk-python/pull/114/checks
Files changed https://github.com/crossplane/function-sdk-python/pull/114/files
Please reload this pagehttps://github.com/crossplane/function-sdk-python/pull/114/files
Pydantic, exclude_defaults=True re-add apiVersion and kind https://github.com/crossplane/function-sdk-python/pull/114/files#top
Show all changes 1 commit https://github.com/crossplane/function-sdk-python/pull/114/files
70e86c0 fix(defaults): add apiVersion and kind haarchri Jan 6, 2025 https://github.com/crossplane/function-sdk-python/pull/114/commits/70e86c0d30a93a64750d29f0b3f1b04543439eee
Clear filters https://github.com/crossplane/function-sdk-python/pull/114/files
Please reload this pagehttps://github.com/crossplane/function-sdk-python/pull/114/files
Please reload this pagehttps://github.com/crossplane/function-sdk-python/pull/114/files
resource.py https://github.com/crossplane/function-sdk-python/pull/114/files#diff-05f183177eba52e1720d1fb16381620d80c3a5f071a87aa09b57177df0f33934
test_resource.py https://github.com/crossplane/function-sdk-python/pull/114/files#diff-cbf27c7a6a4139890bca166895b931c6ad62cff4f4c3bb341cc5eac6757a74b6
v1beta2.py https://github.com/crossplane/function-sdk-python/pull/114/files#diff-8b1928fef6258c8875cc4da874d71e4a36fd6814890f9a137ab502ca0ea70e24
https://github.com/crossplane/function-sdk-python/blob/main/CODEOWNERS#L22
crossplane/function/resource.pyhttps://github.com/crossplane/function-sdk-python/pull/114/files#diff-05f183177eba52e1720d1fb16381620d80c3a5f071a87aa09b57177df0f33934
View file https://github.com/haarchri/function-sdk-python/blob/70e86c0d30a93a64750d29f0b3f1b04543439eee/crossplane/function/resource.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/crossplane/function-sdk-python/pull/114/{{ revealButtonHref }}
https://github.com/crossplane/function-sdk-python/pull/114/files#diff-05f183177eba52e1720d1fb16381620d80c3a5f071a87aa09b57177df0f33934
negzhttps://github.com/negz
Jan 6, 2025https://github.com/crossplane/function-sdk-python/pull/114/files#r1904570199
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/crossplane/function-sdk-python/pull/114/files
negzhttps://github.com/negz
Jan 6, 2025https://github.com/crossplane/function-sdk-python/pull/114/files#r1904571800
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/crossplane/function-sdk-python/pull/114/files
haarchrihttps://github.com/haarchri
Jan 6, 2025https://github.com/crossplane/function-sdk-python/pull/114/files#r1904586632
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/crossplane/function-sdk-python/pull/114/files
haarchrihttps://github.com/haarchri
Jan 7, 2025https://github.com/crossplane/function-sdk-python/pull/114/files#r1904986986
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/crossplane/function-sdk-python/pull/114/files
https://github.com/crossplane/function-sdk-python/pull/114/files#diff-05f183177eba52e1720d1fb16381620d80c3a5f071a87aa09b57177df0f33934
https://github.com/crossplane/function-sdk-python/blob/main/CODEOWNERS#L22
tests/test_resource.pyhttps://github.com/crossplane/function-sdk-python/pull/114/files#diff-cbf27c7a6a4139890bca166895b931c6ad62cff4f4c3bb341cc5eac6757a74b6
View file https://github.com/haarchri/function-sdk-python/blob/70e86c0d30a93a64750d29f0b3f1b04543439eee/tests/test_resource.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/crossplane/function-sdk-python/pull/114/{{ revealButtonHref }}
https://github.com/crossplane/function-sdk-python/pull/114/files#diff-cbf27c7a6a4139890bca166895b931c6ad62cff4f4c3bb341cc5eac6757a74b6
https://github.com/crossplane/function-sdk-python/pull/114/files#diff-cbf27c7a6a4139890bca166895b931c6ad62cff4f4c3bb341cc5eac6757a74b6
https://github.com/crossplane/function-sdk-python/blob/main/CODEOWNERS#L22
tests/testdata/models/io/upbound/aws/s3/v1beta2.pyhttps://github.com/crossplane/function-sdk-python/pull/114/files#diff-8b1928fef6258c8875cc4da874d71e4a36fd6814890f9a137ab502ca0ea70e24
View file https://github.com/haarchri/function-sdk-python/blob/70e86c0d30a93a64750d29f0b3f1b04543439eee/tests/testdata/models/io/upbound/aws/s3/v1beta2.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/crossplane/function-sdk-python/pull/114/{{ revealButtonHref }}
https://github.com/crossplane/function-sdk-python/pull/114/files#diff-8b1928fef6258c8875cc4da874d71e4a36fd6814890f9a137ab502ca0ea70e24
https://github.com/crossplane/function-sdk-python/pull/114/files#diff-8b1928fef6258c8875cc4da874d71e4a36fd6814890f9a137ab502ca0ea70e24
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.