Commit Graph

50 Commits

Author SHA1 Message Date
f966394b63 Merge pull request #888 from andrasio/data-primitives
WIP [data processing]
2019-11-03 16:52:21 -05:00
889d2bb378 Isolate feature. 2019-11-03 16:36:47 -05:00
f57489ed92 get command tests already present and move to their own. 2019-11-02 21:05:27 -05:00
392ff286b2 This commit is ongoing work for making Nu working with data processing
a joy. Fundamentally we embrace functional programming principles for
transforming the dataset from any format picked up by Nu. This table
processing "primitive" commands will build up and make pipelines
composable with data processing capabilities allowing us the valuate,
reduce, and map, the tables as far as even composing this declartively.

On this regard, `split-by` expects some table with grouped data and we
can use it further in interesting ways (Eg. collecting labels for
visualizing the data in charts and/or suit it for a particular chart
of our interest).
2019-10-29 16:04:31 -05:00
571b33a11c Merge pull request #857 from andrasio/group-by
Can group rows by given column name.
2019-10-23 18:25:52 +13:00
f1630da2cc Suggest a column name in case one unknown column is supplied. 2019-10-22 20:10:42 -05:00
6a7c00eaef Finish the job of moving shapes into the stream
This commit should finish the `coloring_in_tokens` feature, which moves
the shape accumulator into the token stream. This allows rollbacks of
the token stream to also roll back any shapes that were added.

This commit also adds a much nicer syntax highlighter trace, which shows
all of the paths the highlighter took to arrive at a particular coloring
output. This change is fairly substantial, but really improves the
understandability of the flow. I intend to update the normal parser with
a similar tracing view.

In general, this change also fleshes out the concept of "atomic" token
stream operations.

A good next step would be to try to make the parser more
error-correcting, using the coloring infrastructure. A follow-up step
would involve merging the parser and highlighter shapes themselves.
2019-10-22 16:19:22 -07:00
0611f56776 Can group cells by given column name. 2019-10-20 18:42:07 -05:00
ec2e35ad81 'last' gets last row if no amount desired given. 2019-10-15 05:41:34 -05:00
5ed1ed54a6 Move off 'sum' to internal command 'count' for tests. 2019-10-15 05:16:47 -05:00
3f60c9d416 'first' gets first row if no amount desired given. 2019-10-15 04:17:55 -05:00
ee8cd671cb Fix bug with multiple input objects to an external command.
Previously, we would build a command that looked something like this:

  <ex_cmd> "$it" "&&" "<ex_cmd>" "$it"

So that the "&&" and "<ex_cmd>" would also be arguments to the command,
instead of a chained command. This commit builds up a command string
that can be passed to an external shell.
2019-10-14 16:47:12 -04:00
7838dac689 first and get coverage. 2019-09-12 05:22:58 -05:00
ba8383ae2f to-[csv/tsv] fixes. 2019-09-10 07:00:25 -05:00
39fce1191f Fix typo 2019-09-04 13:38:17 -04:00
e8764911cb Add comments for sample.{bson,db} 2019-09-04 13:36:12 -04:00
05e858fa94 Add test 2019-09-03 22:37:26 -04:00
cf0efb811e Trim trailing whitespace and set it in editorconfig 2019-09-03 02:52:52 +02:00
9810df25b4 Readability improvement. 2019-08-29 01:31:56 -05:00
55fb1f8dda Yo quiero Playground taconushell. 2019-08-28 19:32:42 -05:00
f82cc4291f Migrate commands_test 2019-08-28 10:58:00 -07:00
21ad06b1e1 Remove unwraps and clean up playground
The original intent of this patch was to remove more unwraps to reduce
panics. I then lost a ton of time to the fact that the playground isn't
in a temp directory (because of permissions issues on Windows).

This commit improves the test facilities to:

- use a tempdir for the playground
- change the playground API so you instantiate it with a block that
  encloses the lifetime of the tempdir
- the block is called with a `dirs` argument that has `dirs.test()` and
  other important directories that we were computing by hand all the time
- the block is also called with a `playground` argument that you can use
  to construct files (it's the same `Playground` as before)
- change the nu! and nu_error! macros to produce output instead of
  taking a variable binding
- change the nu! and nu_error! macros to do the cwd() transformation
  internally
- change the nu! and nu_error! macros to take varargs at the end that
  get interpolated into the running command

I didn't manage to finish porting all of the tests, so a bunch of tests
are currently commented out. That will need to change before we land
this patch.
2019-08-28 10:01:16 -07:00
162c8b4274 swept clean quotes 2019-08-27 06:20:22 -05:00
8940e57cf3 mark #[test] back. (deleted and reverting it from.. 12e38063) 2019-08-25 21:50:55 -05:00
0e14ba86ae [from|to]csv additions/refactoring.
Introduced flag to tell `from-to` / `to-csv` whether we want headers parsed and/or written.
2019-08-25 12:32:08 -05:00
3c89cb7e98 Remove test that refuses to pass on Windows (it's just a minor formatting issue) 2019-08-25 12:25:40 -04:00
376809aa2a Normalize strings for bson tests 2019-08-25 11:43:15 -04:00
e9673c31ea Remove redundant test 2019-08-25 09:50:25 -04:00
a3b4d47b4e Finish last few types and add tests 2019-08-25 09:50:25 -04:00
11095860c8 rm fully operational and error surveyd. 2019-08-20 06:22:11 -05:00
dfcbaed1c6 More descriptive test playground names for commands other than the basic ones. 2019-08-14 15:29:05 -05:00
6cf3dc92fc Add support for utf16 files 2019-08-12 16:11:42 +12:00
aadacc2d36 Merge master 2019-08-09 16:51:21 +12:00
1b7dd52713 Tests pass. 2019-08-07 13:23:02 -05:00
fc173c46d8 Restructuring 2019-08-02 12:15:07 -07:00
1bc1bb6111 Glob paths can fail. Communicates the error if it happens. thanks (jonathandturner) 2019-08-01 16:55:49 -05:00
375f311331 Wildcard support adventure starting with rm command. 2019-08-01 16:01:53 -05:00
0893f89e89 More readable tests. 2019-08-01 04:28:49 -05:00
610a91a658 Test coverage for pull #235 2019-08-01 03:31:41 -05:00
73deeb69db Clean up lint errors 2019-07-23 21:10:48 -07:00
2da43f4b06 Introduced initial cp functionality. 2019-07-21 21:23:02 -05:00
191dacdd8b Introduced conversion to csv command. 2019-07-21 02:08:05 -05:00
c36c2a7b50 Switch from_csv to output rows 2019-07-20 18:44:21 +12:00
08f6d29b79 Fix race condition in test 2019-07-20 13:18:27 +12:00
895a1b2d72 Introduced ability to open csv documents. 2019-07-19 15:48:42 -05:00
514da5bfa7 Can remove files and directories. 2019-07-18 05:21:24 -05:00
f120ce63f7 Test cases not needed for now. 2019-07-16 16:47:01 -05:00
275126d76d Back to passing. Windows test failure needs more investigation. 2019-07-16 06:48:10 -05:00
67a0606b6d Different test data for a format Nu does not recognize. 2019-07-16 06:31:53 -05:00
5ca9d307c6 Integration tests refactoring and visibility in them. 2019-07-16 05:33:41 -05:00