Add explicit truthiness semantics for constant BooleanExpressions
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
- 48/100
Hướng nghiên cứu
Bắt đầu bằng cách xác định BooleanExpression, AlwaysTrue và AlwaysFalse, sau đó kiểm tra các phép kiểm tra biểu thức tùy chọn và việc xử lý residual/filter REST được đề cập trong issue. Xác minh rằng chỉ các biểu thức hằng mới hỗ trợ tính truthiness của Python, các biểu thức không hằng từ chối tính năng này và các giá trị AlwaysFalse() được chỉ định rõ ràng được giữ nguyên thay vì bị coi là bị thiếu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
While this PR can use expression negation via __invert__, I think it may be worth supporting Python truthiness for the constant expressions in a follow-up:
class AlwaysTrue:
def __bool__(self) -> bool:
return True
class AlwaysFalse:
def __bool__(self) -> bool:
return False
That would make patterns like this behave intuitively:
if not self.visit_starts_with(term, literal):
return AlwaysTrue()
When adding this, we should also be careful that Python truthiness is for control flow, not expression construction: not expr returns a Python bool, while ~expr returns a negated BooleanExpression. It would probably be safest for non-constant BooleanExpression.__bool__ to raise, with only AlwaysTrue and AlwaysFalse overriding it. The follow-up should also audit optional-expression checks like expr or AlwaysTrue() and REST residual/filter handling so explicit AlwaysFalse() values are not treated as missing.
Originally posted by @kevinjqliu in https://github.com/apache/iceberg-python/issues/3503#issuecomment-4763176953
- Ngôn ngữ chính
- Python
- Star
- 1.1k
- Fork
- 589
- Merge trung bình
- 2 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 70
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 apache/iceberg-python
-
kind:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
apache/iceberg-python#4006 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/iceberg-python#3996 ·
-
Deletion vector bitmap count is read from the blob and used as a loop bound without validation Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/iceberg-python#3979 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/iceberg-python#3885 ·
-
[Bug] PyArrowFileIO fails to propagate s3.ssl.ca-cert to pyarrow.fs.S3FileSystem tls_ca_file_path Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/iceberg-python#3866 · 1 bình luận ·
Tất cả issue của apache/iceberg-python
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·