Skip to content

Conversation

@github-actions
Copy link

The function would fail with 'TypeError: content.split is not a function'
when data was not a string but also didn't have a content property.

Changes:

  • Add type guard to check if data is string before calling .split()
  • Add support for single log line objects (return as array)
  • Simplify logic with early returns for clearer flow
  • Add comprehensive test suite covering all edge cases

The function now handles:

  1. Data with content property (returns as-is)
  2. String data (parses as newline-separated JSON)
  3. Object data without content (returns wrapped in array)
  4. Edge cases (undefined, null, numbers, invalid JSON)
    (cherry picked from commit a398201)

Co-authored-by: Felix Uellendall feluelle@users.noreply.github.com

…data (#58314)

The function would fail with 'TypeError: content.split is not a function'
when data was not a string but also didn't have a content property.

Changes:
- Add type guard to check if data is string before calling .split()
- Add support for single log line objects (return as array)
- Simplify logic with early returns for clearer flow
- Add comprehensive test suite covering all edge cases

The function now handles:
1. Data with content property (returns as-is)
2. String data (parses as newline-separated JSON)
3. Object data without content (returns wrapped in array)
4. Edge cases (undefined, null, numbers, invalid JSON)
(cherry picked from commit a398201)

Co-authored-by: Felix Uellendall <feluelle@users.noreply.github.com>
@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Nov 17, 2025
@potiuk potiuk marked this pull request as ready for review November 17, 2025 17:14
@ashb ashb merged commit 4cee53b into v3-1-test Nov 17, 2025
54 checks passed
@ashb ashb deleted the backport-a398201-v3-1-test branch November 17, 2025 17:51
ephraimbuddy pushed a commit that referenced this pull request Nov 18, 2025
…data (#58314) (#58399)

The function would fail with 'TypeError: content.split is not a function'
when data was not a string but also didn't have a content property.

Changes:
- Add type guard to check if data is string before calling .split()
- Add support for single log line objects (return as array)
- Simplify logic with early returns for clearer flow
- Add comprehensive test suite covering all edge cases

The function now handles:
1. Data with content property (returns as-is)
2. String data (parses as newline-separated JSON)
3. Object data without content (returns wrapped in array)
4. Edge cases (undefined, null, numbers, invalid JSON)
(cherry picked from commit a398201)

Co-authored-by: Felix Uellendall <feluelle@users.noreply.github.com>
ephraimbuddy pushed a commit that referenced this pull request Nov 19, 2025
…data (#58314) (#58399)

The function would fail with 'TypeError: content.split is not a function'
when data was not a string but also didn't have a content property.

Changes:
- Add type guard to check if data is string before calling .split()
- Add support for single log line objects (return as array)
- Simplify logic with early returns for clearer flow
- Add comprehensive test suite covering all edge cases

The function now handles:
1. Data with content property (returns as-is)
2. String data (parses as newline-separated JSON)
3. Object data without content (returns wrapped in array)
4. Edge cases (undefined, null, numbers, invalid JSON)
(cherry picked from commit a398201)

Co-authored-by: Felix Uellendall <feluelle@users.noreply.github.com>
ephraimbuddy pushed a commit that referenced this pull request Nov 19, 2025
…data (#58314) (#58399)

The function would fail with 'TypeError: content.split is not a function'
when data was not a string but also didn't have a content property.

Changes:
- Add type guard to check if data is string before calling .split()
- Add support for single log line objects (return as array)
- Simplify logic with early returns for clearer flow
- Add comprehensive test suite covering all edge cases

The function now handles:
1. Data with content property (returns as-is)
2. String data (parses as newline-separated JSON)
3. Object data without content (returns wrapped in array)
4. Edge cases (undefined, null, numbers, invalid JSON)
(cherry picked from commit a398201)

Co-authored-by: Felix Uellendall <feluelle@users.noreply.github.com>
ephraimbuddy pushed a commit that referenced this pull request Nov 20, 2025
…data (#58314) (#58399)

The function would fail with 'TypeError: content.split is not a function'
when data was not a string but also didn't have a content property.

Changes:
- Add type guard to check if data is string before calling .split()
- Add support for single log line objects (return as array)
- Simplify logic with early returns for clearer flow
- Add comprehensive test suite covering all edge cases

The function now handles:
1. Data with content property (returns as-is)
2. String data (parses as newline-separated JSON)
3. Object data without content (returns wrapped in array)
4. Edge cases (undefined, null, numbers, invalid JSON)
(cherry picked from commit a398201)

Co-authored-by: Felix Uellendall <feluelle@users.noreply.github.com>
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Dec 1, 2025
@ephraimbuddy ephraimbuddy added this to the Airflow 3.1.4 milestone Dec 2, 2025
ephraimbuddy pushed a commit that referenced this pull request Dec 3, 2025
…data (#58314) (#58399)

The function would fail with 'TypeError: content.split is not a function'
when data was not a string but also didn't have a content property.

Changes:
- Add type guard to check if data is string before calling .split()
- Add support for single log line objects (return as array)
- Simplify logic with early returns for clearer flow
- Add comprehensive test suite covering all edge cases

The function now handles:
1. Data with content property (returns as-is)
2. String data (parses as newline-separated JSON)
3. Object data without content (returns wrapped in array)
4. Edge cases (undefined, null, numbers, invalid JSON)
(cherry picked from commit a398201)

Co-authored-by: Felix Uellendall <feluelle@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants