-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extra columns when reading Delimited file (#12231)
- Closes #12186
- Loading branch information
Showing
8 changed files
with
219 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
distribution/lib/Standard/Table/0.0.0-dev/src/Delimited/Invalid_Rows.enso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from Standard.Base import Boolean, False, True | ||
|
||
## Describes what to do with rows that have unexpected number of columns. | ||
type Invalid_Rows | ||
## Rows that contain too few or too many columns are dropped. | ||
Drop_Invalid_Rows | ||
|
||
## Rows that contain too few or too many columns are kept | ||
|
||
- If a row has too few columns, the missing columns are filled with `Nothing`. | ||
- If it has too many, the extra columns are dropped. | ||
Keep_Invalid_Rows | ||
|
||
## Rows that contain more columns than expected are kept, and the extra columns are added. | ||
|
||
- If a row has too few columns, the missing columns are filled with `Nothing`. | ||
- If it has too many, the extra columns are kept. The previous rows that | ||
had less columns are filled with `Nothing`. | ||
Add_Extra_Columns | ||
|
||
## PRIVATE | ||
A conversion for backward compatibility. | ||
Invalid_Rows.from (that : Boolean) = case that of | ||
True -> Invalid_Rows.Keep_Invalid_Rows | ||
False -> Invalid_Rows.Drop_Invalid_Rows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.