Skip to content

Minor code cleanups - #1800

Open
Thorium wants to merge 1 commit into
fsprojects:mainfrom
Thorium:minor-cleanup
Open

Thorium wants to merge 1 commit into
fsprojects:mainfrom
Thorium:minor-cleanup

Conversation

@Thorium

@Thorium Thorium commented Sep 13, 2026

Copy link
Copy Markdown
Member

Minor code cleanups.

Copilot generated text-wall:
This pull request introduces several improvements and bug fixes across the codebase, with a focus on more robust type inference, performance and correctness in HTML parsing, and better error handling. The most important changes are summarized below:

HTML Parsing Improvements:

  • Refactored the descendantsBy function in HtmlOperations.fs to use an explicit stack for traversing nodes, improving performance and avoiding stack overflows for deeply nested HTML. The traversal is now pre-order and processes children in document order.
  • Updated the hasName function to use a case-insensitive comparison (StringComparison.OrdinalIgnoreCase) for matching node names, ensuring more robust HTML parsing regardless of case.

General Robustness and Error Handling:

  • Improved URI parsing in Helpers.fs by using String.IsNullOrWhiteSpace instead of a manual check, making URI validation more robust and readable.
  • Enhanced error messages in JsonSchema.fs for invalid reference paths, providing more informative feedback when a reference path does not lead through a record.

Type Inference Enhancements:

  • Added a new inferenceMode parameter to the InferColumnTypes method in CsvInference.fs, allowing more control over how types are inferred from CSV data.

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.

1 participant