Skip to content

Commit 02802b2

Browse files
authored
Fixed copy button in examples (#1272)
* Fixed copy button in examples * Fixed examples * Fixed examples
1 parent 4f3147a commit 02802b2

File tree

78 files changed

+77
-46
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+77
-46
lines changed

examples/topics/data_frame/create_entries/description.md renamed to examples/topics/data_frame/create_columns/description.md

Lines changed: 1 addition & 1 deletion

examples/topics/data_frame/data_frame/code.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,20 @@
33
declare(strict_types=1);
44

55
use function Flow\ETL\DSL\{
6-
array_expand,
76
data_frame,
8-
from_rows,
9-
int_entry,
10-
json_entry,
11-
ref,
12-
row,
13-
rows,
7+
from_array,
148
to_stream};
159

1610
data_frame()
1711
->read(
18-
from_rows(
19-
rows(
20-
row(int_entry('id', 1), json_entry('array', ['a' => 1, 'b' => 2, 'c' => 3])),
21-
)
12+
from_array(
13+
[
14+
['id' => 1, 'array' => ['a' => 1, 'b' => 2, 'c' => 3]],
15+
['id' => 2, 'array' => ['a' => 4, 'b' => 5, 'c' => 6]],
16+
['id' => 3, 'array' => ['a' => 7, 'b' => 8, 'c' => 9]],
17+
],
2218
)
2319
)
24-
->withEntry('expanded', array_expand(ref('array')))
20+
->collect()
2521
->write(to_stream(__DIR__ . '/output.txt', truncate: false))
2622
->run();
Lines changed: 10 additions & 1 deletion
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
+----+---------------------+----------+
2-
| id | array | expanded |
3-
+----+---------------------+----------+
4-
| 1 | {"a":1,"b":2,"c":3} | 1 |
5-
| 1 | {"a":1,"b":2,"c":3} | 2 |
6-
| 1 | {"a":1,"b":2,"c":3} | 3 |
7-
+----+---------------------+----------+
1+
+----+---------------------+
2+
| id | array |
3+
+----+---------------------+
4+
| 1 | {"a":1,"b":2,"c":3} |
5+
| 2 | {"a":4,"b":5,"c":6} |
6+
| 3 | {"a":7,"b":8,"c":9} |
7+
+----+---------------------+
88
3 rows
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1
1+
3

0 commit comments

Comments
 (0)