Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#3,926 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
cli

調査の方向性

databricks/bundles/core/_transform.py の199-207行目から始めます。ここでは boolean 変数の文字列が変換され、例外が発生します。"True" と "False" を使用した Azure Pipelines の入力を再現し、他の型の処理を変更せずに、両方の Title Case の値が小文字の相当値と同様に受け入れられることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Go
スター
396
フォーク
233
平均マージ
2日 52分
マージ済み PR(30日)
276

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

databricks/cli のほかの issue

databricks/cli の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。