Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#3,926 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
cli

Direzione di ricerca

Inizia in databricks/bundles/core/_transform.py alle righe 199-207, dove vengono convertite le stringhe delle variabili booleane e viene sollevata l'eccezione. Riproduci l'input di Azure Pipelines con "True" e "False", quindi verifica che entrambi i valori in Title Case siano accettati come i loro equivalenti in minuscolo, senza modificare la gestione degli altri tipi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Go
Stelle
396
Fork
233
Merge medio
2g 52m
PR unite (30g)
276

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di databricks/cli

Tutte le issue di databricks/cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.