You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add StrictBooleans static parameter to CsvProvider (#1621)
When StrictBooleans=true:
- Columns with only 0/1 values are inferred as int (not bool)
- Columns with only yes/no values are inferred as string (not bool)
- Only columns with exclusively true/false values become bool
This implements the feature requested in issue #1417, endorsed by @dsyme.
Co-authored-by: Repo Assist <repo-assist@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>
"""<summary>Typed representation of a CSV file.</summary>
@@ -258,7 +261,8 @@ type public CsvProvider(cfg: TypeProviderConfig) as this =
258
261
<param name='ResolutionFolder'>A directory that is used when resolving relative file references (at design time and in hosted execution).</param>
259
262
<param name='EmbeddedResource'>When specified, the type provider first attempts to load the sample from the specified resource
260
263
(e.g. 'MyCompany.MyAssembly, resource_name.csv'). This is useful when exposing types generated by the type provider.</param>
261
-
<param name='PreferDateOnly'>When true on .NET 6+, date-only strings are inferred as DateOnly and time-only strings as TimeOnly. Defaults to false for backward compatibility.</param>"""
264
+
<param name='PreferDateOnly'>When true on .NET 6+, date-only strings are inferred as DateOnly and time-only strings as TimeOnly. Defaults to false for backward compatibility.</param>
265
+
<param name='StrictBooleans'>When true, only <c>true</c> and <c>false</c> (case-insensitive) are inferred as boolean. Values such as <c>0</c>, <c>1</c>, <c>yes</c>, and <c>no</c> are treated as integers or strings respectively. Defaults to false.</param>"""
262
266
263
267
do csvProvTy.AddXmlDoc helpText
264
268
do csvProvTy.DefineStaticParameters(parameters, buildTypes)
0 commit comments