Resolve inconsistent typing in 37.0.0 delete operations
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- api, backend-api-design
Hướng nghiên cứu
The issue names delete methods in kubernetes/client/api/core_v1_api.py; start by comparing their return type hints with the corresponding generated API definitions and create, patch, and replace methods. Check whether delete responses should consistently use the resource model or the status model, then inspect the related generated tests. Done means the delete methods have consistent, accurate type hints and the tests cover the expected response types.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What is the feature and why do you need it:
The Pydantic migration in 37.0.0 added strong typing, mostly, to the forward facing APIs. Which I greatly appreciate.
Where delete calls used to return V1Status they now generally return the appropriate model for their api type which matches the other APIs including golang.
Unfortunately, the typing is inconsistent on delete calls making it difficult to deal with.
Examples from:
https://raw.githubusercontent.com/kubernetes-client/python/refs/heads/master/kubernetes/client/api/core_v1_api.py
def delete_namespaced_config_map(...) -> object:
def delete_namespaced_endpoints(...) -> object:
def delete_namespaced_persistent_volume_claim(...) -> V1PersistentVolumeClaim:
def delete_namespaced_pod(...) -> V1Pod:
def delete_namespaced_pod_template(...) -> V1PodTemplate:
def delete_namespaced_resource_quota(...) -> V1ResourceQuota:
Describe the solution you'd like to see:
Resolve the inconsistent typehinting on delete calls. For whatever reason create, patch, replace don't have this problem.
Sample code:
>>> import kubernetes
>>> kubernetes.config.load_config()
>>> corev1 = kubernetes.client.api.CoreV1Api()
>>> metadata = kubernetes.client.V1ObjectMeta(name="test", namespace="default")
>>> configmap = kubernetes.client.V1ConfigMap(metadata=metadata)
>>> new_map = corev1.create_namespaced_config_map(namespace="default", body=configmap)
>>> type(new_map)
<class 'kubernetes.client.models.v1_config_map.V1ConfigMap'>
>>> delete_map = corev1.delete_namespaced_config_map(name="test", namespace="default")
>>> type(delete_map)
<class 'dict'>
>>> print(delete_map)
{'kind': 'Status', 'apiVersion': 'v1', 'metadata': {}, 'status': 'Success', 'details': {'name': 'test', 'kind': 'configmaps', 'uid': 'b4e19f90-ed1e-4e44-bed1-0bfbc64e1982'}}
>>> deleted_pot = corev1.delete_namespaced_pod(name="example", namespace="default")
>>> deleted_pod = corev1.delete_namespaced_pod(name="example", namespace="default")
>>> type(deleted_pod)
<class 'kubernetes.client.models.v1_pod.V1Pod'>
- Ngôn ngữ chính
- Python
- Star
- 7.7k
- Fork
- 3.5k
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của kubernetes-client/python
-
getheaders is deprecated in urllib3 >= 2.0.0Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởkind/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
kubernetes-client/python#2280 · 18 bình luận · 9 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Report: UnicodeDecodeError when limit_bytes truncates UTF-8 mid-characterCó thể đã có người làm @carterpewpew đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
kubernetes-client/python#2756 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Make async an extraCó thể đã có người làm @jdork0 đã nhận 5 ngày trước. Đang mởkind/feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
kubernetes-client/python#2739 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Growing library sizeCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởhelp wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
kubernetes-client/python#2677 · 16 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add option to disable strict x509 verifcation in sync clientCó thể đã có người làm @Vishwa0223 đã nhận 64 ngày trước. Đang mởhelp wanted kind/feature
kubernetes-client/python#2602 · 6 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của kubernetes-client/python
Issue tương tự
-
fix(ui): serve bundled fonts from the gatewayCó thể đã có người làm @dkritarth đã nhận hôm nay. Đang mởagent: in-progress agent: ready P3 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
dkritarth/scopewatch#336 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bob
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
khuisman/mcp-gee-sweet#1267 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
open-webui/open-webui#33285 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tv-list
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Gathin23/cleanyourtv#2337 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày