Accept Title-Case Representation of Booleans to Adapt for awkward Azure Pipelines Behaviour
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Bắt đầu trong databricks/bundles/core/_transform.py tại các dòng 199-207, nơi các chuỗi biến boolean được chuyển đổi và ngoại lệ được phát sinh. Tái hiện đầu vào của Azure Pipelines với "True" và "False", sau đó xác minh rằng cả hai giá trị ở dạng Title Case đều được chấp nhận giống như các giá trị tương đương viết thường, mà không thay đổi cách xử lý các kiểu khác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the issue
Variable resolution in asset bundles only accepts "true"/"false" literals, while Azure Pipelines passes "True"/"False".
Configuration
Azure Pipelines sending boolean parameters to Asset Bundles' /bundles/core/_transform.py:199-207.
Steps to reproduce the behavior
Declare some asset bundle variable as Variable[bool], then pass "True" to it. Like Azure DevOps Pipelines do.
Expected Behavior
Asset Bundles accepts the passed string as boolean value. Like it does for the lowercase variant.
Actual Behavior
Asset Bundles raises an exception (see below) and fails.
OS and CLI version
Azure Pipeline runners on linux, databricks-bundles==0.265.0. But the _transform() function is unchanged in the latest version.
Is this a regression?
Not that I know of.
Debug Logs
Error: Failed to load resources
in resources/__init__.py:108:1
Traceback (most recent call last):
File "/mnt/vss/_work/1/s/.venv/lib/python3.10/site-packages/databricks/bundles/core/_bundle.py", line 90, in resolve_variable
return _transform(variable.type, value)
File "/mnt/vss/_work/1/s/.venv/lib/python3.10/site-packages/databricks/bundles/core/_transform.py", line 207, in _transform
raise ValueError(f"Unexpected type: {cls} for '{value}'")
ValueError: Unexpected type: <class 'bool'> for 'False'
Is this a bug?
Of course this could be considered a Azure DevOps Pipelines bug. Why are they keeping the Python-style string cast for bools? But as that would be a breaking change on their side and is thus unlikely to happen, we should consider adapting here.
Or course this can be worked around by explicitly lowercasing the bool. But that's far from obvious as shown in this azure devops pipeline:
parameters:
- name: enableFeature
displayName: Enable Feature?
type: boolean
default: true
jobs:
- job: deploy
pool:
vmImage: 'ubuntu-latest'
steps:
- bash: |
# Azure Pipelines passes boolean as "True" or "False"
echo "Parameter value: ${{ parameters.enableFeature }}"
# This FAILS - Databricks rejects title-case:
databricks bundle deploy --var="my_bool=${{ parameters.enableFeature }}"
# Workaround - convert to lowercase:
# databricks bundle deploy --var="my_bool=${{ lower(parameters.enableFeature) }}"
displayName: Deploy Bundle
- Ngôn ngữ chính
- Go
- Star
- 396
- Fork
- 233
- Merge trung bình
- 2 ngày 52 phút
- Pull request đã merge (30 ngày)
- 276
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 databricks/cli
-
DABs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
databricks/cli#6670 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
databricks/cli#6786 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
databricks/cli#6785 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
databricks/cli#6770 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 20/100
databricks/cli#6765 ·
Tất cả issue của databricks/cli
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
googleapis/librarian#7670 · 2 bình luận ·