Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Number Column With Fixed Size #472

Merged
merged 3 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EntityFrameworkCoreExtension</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.Autofac/Paillave.Etl.Autofac.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.Autofac</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.Bloomberg/Paillave.Etl.Bloomberg.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.Bloomberg</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.Dropbox/Paillave.Etl.Dropbox.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.Dropbox</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.EntityFrameworkCore</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.ExcelFile/Paillave.Etl.ExcelFile.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.ExcelFile</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.ExecutionToolkit</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.FileSystem/Paillave.Etl.FileSystem.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.FileSystem</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.FromConfigurationConnectors</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.Ftp/Paillave.Etl.Ftp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.Ftp</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.GraphApi/Paillave.Etl.GraphApi.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.GraphApi</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.Mail/Paillave.Etl.Mail.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.Mail</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.Pdf/Paillave.Etl.Pdf.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.Pdf</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.Sftp/Paillave.Etl.Sftp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.Sftp</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.SqlServer/Paillave.Etl.SqlServer.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.SqlServer</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
5 changes: 4 additions & 1 deletion src/Paillave.Etl.TextFile/FlatFileDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ public FlatFileDefinition<T> WithMap(Expression<Func<IFieldMapper, T>> expressio
}
if (vis.MappingSetters.Any(i => i.Size.HasValue))
{
if (!vis.MappingSetters.All(i => i.Size.HasValue)) throw new InvalidOperationException("if a size is given, all sizes must be given");
if (!vis.MappingSetters.All(i => i.Size.HasValue))
throw new InvalidOperationException(
$"if a size is given, all sizes must be given: missing size for columns with indexes: {string.Join(", ", vis.MappingSetters.Where(i => !i.Size.HasValue).Select(i => i.ColumnIndex))}.");

this.HasFixedColumnWidth(vis.MappingSetters.OrderBy(i => i.ColumnIndex).Select(i => i.Size.Value).ToArray());
}
return this;
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.TextFile/Paillave.Etl.TextFile.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.TextFile</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.XmlFile/Paillave.Etl.XmlFile.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.XmlFile</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl.Zip/Paillave.Etl.Zip.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.Zip</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 2 additions & 0 deletions src/Paillave.Etl/Core/Mapping/Visitors/DummyFieldMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public T ToNumberColumn<T>(int columnIndex, int size, string decimalSeparator, s
this.MappingSetter.DecimalSeparator = decimalSeparator;
this.MappingSetter.GroupSeparator = groupSeparator;
this.MappingSetter.ColumnIndex = columnIndex;
this.MappingSetter.Size = size;
return default;
}

Expand All @@ -118,6 +119,7 @@ public T ToNumberColumn<T>(int columnIndex, int size, string decimalSeparator)
this.MappingSetter.DecimalSeparator = decimalSeparator;
this.MappingSetter.GroupSeparator = null;
this.MappingSetter.ColumnIndex = columnIndex;
this.MappingSetter.Size = size;
return default;
}
#endregion
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Etl/Paillave.Etl.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.EtlNet.Core</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
2 changes: 1 addition & 1 deletion src/Paillave.Pdf/Paillave.Pdf.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Paillave.Pdf</PackageId>
<Version>2.1.16-beta</Version>
<Version>2.1.17-beta</Version>
<Authors>Stéphane Royer</Authors>
<Company></Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
Loading