Skip to content

Commit

Permalink
fixed csv record null value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronnie Overby committed Apr 28, 2020
1 parent daeab79 commit 5f3633f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Overby.LINQPad.FileDriver/Csv/CsvGenerator.cs
Expand Up @@ -37,7 +37,8 @@ public IFileConfig UpdateFileConfig(FileInfo file, IFileConfig prevConfig)
record: record)
select
from k in rec.Keys
select (k, rec[k]);
let value = rec.ContainsKey(k) ? "" : rec[k]
select (k, value);

bool IsNullString(string s) =>
string.IsNullOrEmpty(s) || csvConfig.NullStrings.Values.Contains(s);
Expand Down
Expand Up @@ -7,8 +7,8 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageTags>linqpaddriver</PackageTags>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Version>0.0.1-alpha4</Version>
<FileVersion>0.0.1.4</FileVersion>
<Version>0.0.1-alpha5</Version>
<FileVersion>0.0.1.5</FileVersion>
<PackageReleaseNotes>Initial nuget release.</PackageReleaseNotes>
<Description>Query local data files in LINQPad!</Description>
<Copyright>2020 Ronnie Overby</Copyright>
Expand Down
Expand Up @@ -36,7 +36,7 @@ public static class TypeInferrer
// no need
continue;

var value = rawValue.Trim();
var value = rawValue == null ? "" : rawValue.Trim();

// for similar types (numerics/dates/bools) parse from least wide to most wide types

Expand Down

0 comments on commit 5f3633f

Please sign in to comment.