Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Accept Title-Case Representation of Booleans to Adapt for awkward Azure Pipelines Behaviour

Đang mở Phù hợp với người mới
#3,926 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
cli

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ả

DABs PyDABs
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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của databricks/cli

Tất cả issue của databricks/cli

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.