Skip to content

[Repo Assist] Emit diagnostic warning when Sample path not found, falling back to inline content#1658

Closed
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-953-inline-fallback-warning-f2cf3d4597c845b2
Closed

[Repo Assist] Emit diagnostic warning when Sample path not found, falling back to inline content#1658
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-953-inline-fallback-warning-f2cf3d4597c845b2

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant. Please review carefully before merging.

Closes #953

Problem

When a relative path is given as the Sample parameter (e.g., CsvProvider<"../export.csv">), the type provider tries to resolve it as a file. If the file doesn't exist, it silently falls back to treating the value as inline content. This caused very confusing downstream errors — for example, when Schema is also specified, the user sees:

The provided schema contains 17 columns, the inference found 1 columns — please check the number of columns and the separator

...with no indication that the path wasn't found.

Fix

Added a single eprintfn diagnostic in CommonProviderImplementation/Helpers.fs at the point where the fallback-to-inline occurs:

FSharp.Data: the path '../export.csv' was not found; treating the value as inline CSV content.

This message is emitted to stderr, which is visible in F# Interactive and in IDE output panels.

Root cause

The relevant code is in src/FSharp.Data.DesignTime/CommonProviderImplementation/Helpers.fs, the infrastructure shared across all type providers (CSV, JSON, HTML, XML). The fallback is intentional (it supports inline samples like CsvProvider<"Name,Age\nAlice,30">), but was silent.

Changes

  • src/FSharp.Data.DesignTime/CommonProviderImplementation/Helpers.fs: Add eprintfn warning before the fallback parse attempt
  • RELEASE_NOTES.md: Add entry for 7.0.2

Test Status

✅ Build succeeded with 0 errors (13 pre-existing warnings, unrelated to this change).

Tests were not run in this environment due to infrastructure constraints, but the change is minimal (one eprintfn added) and does not affect the control flow or return values of the function.

Generated by Repo Assist for issue #953

To install this workflow, run gh aw add githubnext/agentics/workflows/repo-assist.md@f2c5cf1e4af58e09a93ba0703c6bf084711b265f. View source at https://github.com/githubnext/agentics/tree/f2c5cf1e4af58e09a93ba0703c6bf084711b265f/workflows/repo-assist.md.

…o inline content

When a relative URI is provided as Sample but cannot be resolved as a file path,
the type provider silently falls back to treating the value as inline content.
This caused confusing errors (e.g. schema column mismatch) with no indication
that the path wasn't found.

Now emits an eprintfn diagnostic: 'FSharp.Data: the path '...' was not found;
treating the value as inline <format> content.'

Fixes #953

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CSV Type provider] When path to csv file is wrong, type provider shows strange errors.

1 participant