Skip to content

Commit 63dfb08

Browse files
committed
Quickstart fix.
1 parent 9498b50 commit 63dfb08

File tree

2 files changed

+20
-32
lines changed

2 files changed

+20
-32
lines changed

README.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,29 +62,23 @@ df = wr.redshift.read_sql_query("SELECT * FROM external_schema.my_table", con=co
6262
con.close()
6363

6464
# Amazon Timestream Write
65-
df = pd.DataFrame(
66-
{
67-
"time": [datetime.now(), datetime.now(), datetime.now()],
68-
"dim0": ["foo", "boo", "bar"],
69-
"dim1": [1, 2, 3],
70-
"measure": [1.0, 1.1, 1.2],
71-
}
72-
)
73-
rejected_records = wr.timestream.write(
74-
df=df,
65+
df = pd.DataFrame({
66+
"time": [datetime.now(), datetime.now()],
67+
"my_dimension": ["foo", "boo"],
68+
"measure": [1.0, 1.1],
69+
})
70+
rejected_records = wr.timestream.write(df,
7571
database="sampleDB",
7672
table="sampleTable",
7773
time_col="time",
7874
measure_col="measure",
79-
dimensions_cols=["dim0", "dim1"],
75+
dimensions_cols=["my_dimension"],
8076
)
8177

82-
# Amazon Timestream Write
78+
# Amazon Timestream Query
8379
wr.timestream.query("""
84-
SELECT
85-
time, measure_value::double, dim0, dim1
86-
FROM "sampleDB"."sampleTable"
87-
ORDER BY time DESC LIMIT 3
80+
SELECT time, measure_value::double, dim0, dim1
81+
FROM "sampleDB"."sampleTable" ORDER BY time DESC LIMIT 3
8882
""")
8983

9084
```

docs/source/index.rst

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,23 @@ Quick Start
3333
con.close()
3434
3535
# Amazon Timestream Write
36-
df = pd.DataFrame(
37-
{
38-
"time": [datetime.now(), datetime.now(), datetime.now()],
39-
"dim0": ["foo", "boo", "bar"],
40-
"dim1": [1, 2, 3],
41-
"measure": [1.0, 1.1, 1.2],
42-
}
43-
)
44-
rejected_records = wr.timestream.write(
45-
df=df,
36+
df = pd.DataFrame({
37+
"time": [datetime.now(), datetime.now()],
38+
"my_dimension": ["foo", "boo"],
39+
"measure": [1.0, 1.1],
40+
})
41+
rejected_records = wr.timestream.write(df,
4642
database="sampleDB",
4743
table="sampleTable",
4844
time_col="time",
4945
measure_col="measure",
50-
dimensions_cols=["dim0", "dim1"],
46+
dimensions_cols=["my_dimension"],
5147
)
5248
53-
# Amazon Timestream Write
49+
# Amazon Timestream Query
5450
wr.timestream.query("""
55-
SELECT
56-
time, measure_value::double, dim0, dim1
57-
FROM "sampleDB"."sampleTable"
58-
ORDER BY time DESC LIMIT 3
51+
SELECT time, measure_value::double, dim0, dim1
52+
FROM "sampleDB"."sampleTable" ORDER BY time DESC LIMIT 3
5953
""")
6054
6155
Read The Docs

0 commit comments

Comments
 (0)