Skip to content

fix: support aggregate field dictionaries in get_list (backport #65) - #72

Merged
barredterra merged 2 commits into
version-15from
mergify/bp/version-15/pr-65
Jul 20, 2026
Merged

fix: support aggregate field dictionaries in get_list (backport #65)#72
barredterra merged 2 commits into
version-15from
mergify/bp/version-15/pr-65

Conversation

@mergify

@mergify mergify Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

This is an automatic backport of pull request #65 done by [Mergify](https://mergify.com).

(cherry picked from commit ab0ca7a)

# Conflicts:
#	ask_alyf/ask_alyf/tools.py
@mergify

This comment was marked as resolved.

@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — all three changed files are logically consistent, the previously flagged merge conflict is resolved, and the new test covers the fixed behavior.

The refactored coerce_field_list correctly handles the three input shapes (None, str, list) and properly threads dict entries through without modification. The type alias, updated signatures, and docstrings are all consistent with the implementation. No regressions were found in the existing code paths.

No files require special attention.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["coerce_field_list(value)"] --> B{value is None?}
    B -- Yes --> C[return None]
    B -- No --> D{value is str?}
    D -- Yes --> E[strip value]
    E --> F{stripped is empty?}
    F -- Yes --> C
    F -- No --> G[try json.loads]
    G -- success, is list --> H[value = parsed list]
    G -- fail or not list --> I["value = stripped.split(',')"]
    D -- No, already a list --> J[use value as-is]
    H --> K
    I --> K
    J --> K["list comprehension over value"]
    K --> L{entry is dict?}
    L -- Yes, non-empty --> M[keep dict as-is]
    L -- No --> N["str(entry).strip(), skip if empty"]
    M --> O[return list of FrappeSelectField]
    N --> O
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["coerce_field_list(value)"] --> B{value is None?}
    B -- Yes --> C[return None]
    B -- No --> D{value is str?}
    D -- Yes --> E[strip value]
    E --> F{stripped is empty?}
    F -- Yes --> C
    F -- No --> G[try json.loads]
    G -- success, is list --> H[value = parsed list]
    G -- fail or not list --> I["value = stripped.split(',')"]
    D -- No, already a list --> J[use value as-is]
    H --> K
    I --> K
    J --> K["list comprehension over value"]
    K --> L{entry is dict?}
    L -- Yes, non-empty --> M[keep dict as-is]
    L -- No --> N["str(entry).strip(), skip if empty"]
    M --> O[return list of FrappeSelectField]
    N --> O
Loading

Reviews (2): Last reviewed commit: "chore: resolve merge conflict" | Re-trigger Greptile

Comment thread ask_alyf/ask_alyf/tools.py Outdated
@barredterra
barredterra merged commit a713086 into version-15 Jul 20, 2026
5 checks passed
@barredterra
barredterra deleted the mergify/bp/version-15/pr-65 branch July 20, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant