Skip to content

Commit 59fe9dc

Browse files
committed
Fix typos in chunk 4 (files 41-50)
1 parent 1162f98 commit 59fe9dc

File tree

10 files changed

+52
-52
lines changed

10 files changed

+52
-52
lines changed

api-reference/queries/endpoint/unarchive.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In Dune context, delete action is replaced by archive as deletion of queries is
1414
<RequestExample>
1515

1616
```bash cURL
17-
curl --request GET \
17+
curl --request POST \
1818
--url https://api.dune.com/api/v1/query/{queryId}/unarchive \
1919
--header 'X-DUNE-API-KEY: <x-dune-api-key>'
2020
```
@@ -37,14 +37,14 @@ url = "https://api.dune.com/api/v1/query/{queryId}/unarchive"
3737

3838
headers = {"X-DUNE-API-KEY": "<x-dune-api-key>"}
3939

40-
response = requests.request("GET", url, headers=headers)
40+
response = requests.request("POST", url, headers=headers)
4141

4242
print(response.text)
4343

4444
```
4545

4646
```javascript JavaScript
47-
const options = {method: 'GET', headers: {'X-DUNE-API-KEY': '<x-dune-api-key>'}};
47+
const options = {method: 'POST', headers: {'X-DUNE-API-KEY': '<x-dune-api-key>'}};
4848

4949
fetch('https://api.dune.com/api/v1/query/{queryId}/unarchive', options)
5050
.then(response => response.json())
@@ -65,7 +65,7 @@ func main() {
6565

6666
url := "https://api.dune.com/api/v1/query/{queryId}/unarchive"
6767

68-
req, _ := http.NewRequest("GET", url, nil)
68+
req, _ := http.NewRequest("POST", url, nil)
6969

7070
req.Header.Add("X-DUNE-API-KEY", "<x-dune-api-key>")
7171

@@ -92,7 +92,7 @@ curl_setopt_array($curl, [
9292
CURLOPT_MAXREDIRS => 10,
9393
CURLOPT_TIMEOUT => 30,
9494
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
95-
CURLOPT_CUSTOMREQUEST => "GET",
95+
CURLOPT_CUSTOMREQUEST => "POST",
9696
CURLOPT_HTTPHEADER => [
9797
"X-DUNE-API-KEY: <x-dune-api-key>"
9898
],
@@ -111,7 +111,7 @@ if ($err) {
111111
```
112112

113113
```java Java
114-
HttpResponse<String> response = Unirest.get("https://api.dune.com/api/v1/query/{queryId}/unarchive")
114+
HttpResponse<String> response = Unirest.post("https://api.dune.com/api/v1/query/{queryId}/unarchive")
115115
.header("X-DUNE-API-KEY", "<x-dune-api-key>")
116116
.asString();
117117
```

api-reference/queries/endpoint/unprivate.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To access Query endpoints, an [Analyst plan](https://dune.com/pricing) or higher
1010
<RequestExample>
1111

1212
```bash cURL
13-
curl --request GET \
13+
curl --request POST \
1414
--url https://api.dune.com/api/v1/query/{queryId}/unprivate \
1515
--header 'X-DUNE-API-KEY: <x-dune-api-key>'
1616
```
@@ -33,14 +33,14 @@ url = "https://api.dune.com/api/v1/query/{queryId}/unprivate"
3333

3434
headers = {"X-DUNE-API-KEY": "<x-dune-api-key>"}
3535

36-
response = requests.request("GET", url, headers=headers)
36+
response = requests.request("POST", url, headers=headers)
3737

3838
print(response.text)
3939

4040
```
4141

4242
```javascript JavaScript
43-
const options = {method: 'GET', headers: {'X-DUNE-API-KEY': '<x-dune-api-key>'}};
43+
const options = {method: 'POST', headers: {'X-DUNE-API-KEY': '<x-dune-api-key>'}};
4444

4545
fetch('https://api.dune.com/api/v1/query/{queryId}/unprivate', options)
4646
.then(response => response.json())
@@ -61,7 +61,7 @@ func main() {
6161

6262
url := "https://api.dune.com/api/v1/query/{queryId}/unprivate"
6363

64-
req, _ := http.NewRequest("GET", url, nil)
64+
req, _ := http.NewRequest("POST", url, nil)
6565

6666
req.Header.Add("X-DUNE-API-KEY", "<x-dune-api-key>")
6767

@@ -88,7 +88,7 @@ curl_setopt_array($curl, [
8888
CURLOPT_MAXREDIRS => 10,
8989
CURLOPT_TIMEOUT => 30,
9090
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
91-
CURLOPT_CUSTOMREQUEST => "GET",
91+
CURLOPT_CUSTOMREQUEST => "POST",
9292
CURLOPT_HTTPHEADER => [
9393
"X-DUNE-API-KEY: <x-dune-api-key>"
9494
],
@@ -107,7 +107,7 @@ if ($err) {
107107
```
108108

109109
```java Java
110-
HttpResponse<String> response = Unirest.get("https://api.dune.com/api/v1/query/{queryId}/unprivate")
110+
HttpResponse<String> response = Unirest.post("https://api.dune.com/api/v1/query/{queryId}/unprivate")
111111
.header("X-DUNE-API-KEY", "<x-dune-api-key>")
112112
.asString();
113113
```

api-reference/queries/endpoint/update.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@ query = dune.update_query(
3535
)
3636
```
3737

38-
```python Python
38+
```bash cURL
3939
curl --request PATCH \
4040
--url https://api.dune.com/api/v1/query/{queryId} \
4141
--header 'Content-Type: application/json' \
4242
--header 'X-DUNE-API-KEY: <x-dune-api-key>' \
4343
--data '{
4444
"query_id": 1252207,
45-
"query_sql": "{{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}"
45+
"query_sql": "SELECT * FROM {{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}"
4646
}'
4747
```
4848

4949
```javascript JavaScript
5050
const options = {
5151
method: 'PATCH',
5252
headers: {'X-DUNE-API-KEY': '<x-dune-api-key>', 'Content-Type': 'application/json'},
53-
body: '{"query_id":1252207,"query_sql":"{{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}"}'
53+
body: '{"query_id":1252207,"query_sql":"SELECT * FROM {{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}"}'
5454
};
5555

5656
fetch('https://api.dune.com/api/v1/query/{queryId}', options)
@@ -73,7 +73,7 @@ func main() {
7373

7474
url := "https://api.dune.com/api/v1/query/{queryId}"
7575

76-
payload := strings.NewReader("{\n \"query_id\": 1252207,\n ,\n \"query_sql\": \"{{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}\"}")
76+
payload := strings.NewReader("{\n \"query_id\": 1252207,\n \"query_sql\": \"SELECT * FROM {{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}\"}")
7777

7878
req, _ := http.NewRequest("PATCH", url, payload)
7979

@@ -104,7 +104,7 @@ curl_setopt_array($curl, [
104104
CURLOPT_TIMEOUT => 30,
105105
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
106106
CURLOPT_CUSTOMREQUEST => "PATCH",
107-
CURLOPT_POSTFIELDS => "{\n \"query_id\": 1252207,\n \"query_sql\": \"{{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}\"}",
107+
CURLOPT_POSTFIELDS => "{\n \"query_id\": 1252207,\n \"query_sql\": \"SELECT * FROM {{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}\"}",
108108
CURLOPT_HTTPHEADER => [
109109
"Content-Type: application/json",
110110
"X-DUNE-API-KEY: <x-dune-api-key>"
@@ -127,7 +127,7 @@ if ($err) {
127127
HttpResponse<String> response = Unirest.patch("https://api.dune.com/api/v1/query/{queryId}")
128128
.header("X-DUNE-API-KEY", "<x-dune-api-key>")
129129
.header("Content-Type", "application/json")
130-
.body("{\n \"query_id\": 1252207,\n \"query_sql\": \"{{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}\"}")
130+
.body("{\n \"query_id\": 1252207,\n \"query_sql\": \"SELECT * FROM {{blockchain}}.transactions WHERE to = {{address}} AND block_number > {{blocknumber}}\"}")
131131
.asString();
132132
```
133133

api-reference/quickstart/queries-eg.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In this quickstart, we will walk through how to turn any dashboard (or set of qu
66

77
### Prerequisites
88
- Python environment set up (check out [Anaconda Navigator](https://docs.continuum.io/free/navigator/) if you want somewhere to start.)
9-
- Have a Dune API key from the team/user who's queries you want to manage (to obtain one [follow the steps here](../overview/authentication#generate-an-api-key))
9+
- Have a Dune API key from the team/user whose queries you want to manage (to obtain one [follow the steps here](../overview/authentication#generate-an-api-key))
1010

1111
### Set up a new repo from the GitHub template
1212

api-reference/quickstart/results-eg.mdx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,27 +97,27 @@ You can choose to either get the latest query result without triggering an execu
9797
<Tabs>
9898
<Tab title="Get latest result without execution">
9999
```python
100-
query_result = dune.get_latest_result(3373921) # get latest result in json format
101-
# query_result = dune.get_latest_result_dataframe(3373921) # get latest result in Pandas dataframe format
102-
```
100+
query_result = dune.get_latest_result(3373921) # get latest result in json format
101+
# query_result = dune.get_latest_result_dataframe(3373921) # get latest result in Pandas dataframe format
102+
```
103103
</Tab>
104-
<Tab title="Query a query">
105-
```python
106-
query = QueryBase(
107-
query_id=3373921,
108-
109-
# uncomment and change the parameter values if needed
110-
# params=[
111-
# QueryParameter.text_type(name="contract", value="0x6B175474E89094C44Da98b954EedeAC495271d0F"), # default is DAI
112-
# QueryParameter.text_type(name="owner", value="owner"), # default using vitalik.eth's wallet
113-
# ],
114-
)
104+
<Tab title="Query a query">
105+
```python
106+
query = QueryBase(
107+
query_id=3373921,
108+
109+
# uncomment and change the parameter values if needed
110+
# params=[
111+
# QueryParameter.text_type(name="contract", value="0x6B175474E89094C44Da98b954EedeAC495271d0F"), # default is DAI
112+
# QueryParameter.text_type(name="owner", value="owner"), # default using vitalik.eth's wallet
113+
# ],
114+
)
115115

116116
query_result = dune.run_query_dataframe(
117-
query=query
118-
# , ping_frequency = 10 # uncomment to change the seconds between checking execution status, default is 1 second
119-
# , performance="large" # uncomment to run query on large engine, default is medium
120-
# , batch_size = 5_000 # uncomment to change the maximum number of rows to retrieve per batch of results, default is 32_000
117+
query=query
118+
# , ping_frequency = 10 # uncomment to change the seconds between checking execution status, default is 1 second
119+
# , performance="large" # uncomment to run query on large engine, default is medium
120+
# , batch_size = 5_000 # uncomment to change the maximum number of rows to retrieve per batch of results, default is 32_000
121121
)
122122

123123
# Note: to get the result in csv format, call run_query_csv(); for json format, call run_query().
@@ -164,10 +164,10 @@ You can choose to either get the latest query result without triggering an execu
164164
)
165165

166166
query_result = dune.run_query_dataframe(
167-
query=query
168-
# , ping_frequency = 10 # uncomment to change the seconds between checking execution status, default is 1 second
169-
# , performance="large" # uncomment to run query on large engine, default is medium
170-
# , batch_size = 5_000 # uncomment to change the maximum number of rows to retrieve per batch of results, default is 32_000
167+
query=query
168+
# , ping_frequency = 10 # uncomment to change the seconds between checking execution status, default is 1 second
169+
# , performance="large" # uncomment to run query on large engine, default is medium
170+
# , batch_size = 5_000 # uncomment to change the maximum number of rows to retrieve per batch of results, default is 32_000
171171
)
172172

173173
# Note: to get the result in csv format, call run_query_csv(); for json format, call run_query().

api-reference/quickstart/tables-eg.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ DUNE_API_KEY=<paste your API key here>
1616
</Tip>
1717

1818
### Upload the CSV
19-
Follow below steps to upload your CSV. Please make sure to modify paths to your .env file and to your CSV file.
19+
Follow the below steps to upload your CSV. Please make sure to modify paths to your .env file and to your CSV file.
2020

2121
```python
2222
import dotenv, os
@@ -45,7 +45,7 @@ with open(csv_file_path) as open_file:
4545

4646
Once the upload is successful, you will see the data show up under [Your Data](https://dune.com/queries?category=uploaded_data) in the Data Explorer.
4747

48-
You can query your uploaded table under the name `dune.<team or user handle>.dataset_<table name defined>`. For example, here I defined the table name to be "cereal_table" and my team name is "dune", so to access the uploaded table we will do `select * from dune.dune.dataset_cereal_table`
48+
You can query your uploaded table under the name `dune.<team or user handle>.dataset_<table name defined>`. For example, here I defined the table name to be "cereal_table" and my team name is "dune", so to access the uploaded table we will do `select * from dune.dune.dataset_cereal_table`.
4949

5050

5151

api-reference/tables/endpoint/clear.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ headers = {
2323
"X-DUNE-API-KEY": "<x-dune-api-key>"
2424
}
2525

26-
response = requests.request("POST", url, data=data, headers=headers)
26+
response = requests.request("POST", url, headers=headers)
2727
```
2828

2929
</RequestExample>

api-reference/tables/endpoint/create.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The resulting table will be empty, and can be inserted into with the [/insert en
1313
</Note>
1414

1515
## Schema
16-
You need to define the schema of your data by providing `schema` array of columns in the request. Each column has three parameters:
16+
You need to define the schema of your data by providing a `schema` array of columns in the request. Each column has three parameters:
1717

1818
**name**: the name of the field
1919

@@ -61,7 +61,7 @@ table = dune.create_table(
6161
```typescript TS SDK
6262
import { DuneClient, ColumnType } from "@duneanalytics/client-sdk";
6363

64-
client = new DuneClient(process.env.DUNE_API_KEY!);
64+
const client = new DuneClient(process.env.DUNE_API_KEY!);
6565
const result = await client.table.create({
6666
namespace: "my_user",
6767
table_name: "interest_rates",

api-reference/tables/endpoint/insert.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To be able to insert into a table, it must have been created with the [/create e
77

88
<Note>
99
- The data in the files must conform to the schema, and must use the same column names as the schema.
10-
- One successful `/insert` request consumes 1 credits.
10+
- One successful `/insert` request consumes 1 credit.
1111
- The maximum request size is 1.2GB
1212
</Note>
1313

@@ -19,7 +19,7 @@ A status code of 200 means that the data in the request was successfully inserte
1919
If you get any other status code, you can safely retry your request after addressing the issue that the error message indicated.
2020

2121
## Concurrent requests
22-
A limited number of concurrent insertion requests per table is supported. However, there will be a slight performance penalty as we serialize the writes behind the scenes to ensure data integrity. Larger number of concurrent requests per table may result in an increased number of failures. Therefore, we recommend managing your requests within a 5-10 threshold to maintain optimal performance.
22+
A limited number of concurrent insertion requests per table is supported. However, there will be a slight performance penalty as we serialize the writes behind the scenes to ensure data integrity. A larger number of concurrent requests per table may result in an increased number of failures. Therefore, we recommend managing your requests within a 5-10 threshold to maintain optimal performance.
2323

2424
## Supported filetypes
2525
### CSV files (`Content-Type: text/csv`)
@@ -32,15 +32,15 @@ Each line must have keys that match the column names of the table.
3232
## Data types
3333
DuneSQL supports a variety of types which are not natively supported in many data exchange formats. Here we provide guidance on how to work with such types.
3434
### Varbinary values
35-
When uploading varbinary data using JSON or CSV formats, you need to convert the binary data into a textual representation. Reason being, JSON or CSV don't natively support binary values. There are many ways to transform binary data to a textual representation. We support **hexadecimal** and **base64** encodings.
35+
When uploading varbinary data using JSON or CSV formats, you need to convert the binary data into a textual representation. The reason being, JSON or CSV don't natively support binary values. There are many ways to transform binary data to a textual representation. We support **hexadecimal** and **base64** encodings.
3636

3737
#### base64
3838
Base64 is a binary-to-text encoding scheme that transforms binary data into a sequence of characters. All characters are taken from a set of 64 characters.
3939

4040
Example: `{"varbinary_column":"SGVsbG8gd29ybGQK"}`
4141

4242
#### hexadecimal
43-
In the hexadecimal representation input data should contain an even number of characters in the range `[0-9a-fA-F]` always prefixed with `0x`.
43+
In the hexadecimal representation, input data should contain an even number of characters in the range `[0-9a-fA-F]` always prefixed with `0x`.
4444

4545
Example: `{"varbinary_column":"0x92b7d1031988c7af"}`
4646

@@ -74,7 +74,7 @@ with open("./interest_rates.csv", "rb") as data:
7474
import * as fs from "fs/promises";
7575
import { DuneClient, ContentType } from "@duneanalytics/client-sdk";
7676

77-
client = new DuneClient(process.env.DUNE_API_KEY!);
77+
const client = new DuneClient(process.env.DUNE_API_KEY!);
7878
const data = await fs.readFile("./sample_table_insert.csv");
7979
// Or JSON
8080
// const data: Buffer = await fs.readFile("./sample_table_insert.json");

api-reference/tables/endpoint/upload.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For working with uploads, keep in mind that:
1616
- File has to be < 200 MB
1717
- Column names in the table can't start with a special character or digits.
1818
- Private uploads require a Premium subscription.
19-
- If you upload to an existing table name, it will delete the old data and overwite it with your new data. Appends are only supported for the `/create`, `/insert` endpoints.
19+
- If you upload to an existing table name, it will delete the old data and overwrite it with your new data. Appends are only supported for the `/create`, `/insert` endpoints.
2020
- To delete an upload table, you must go to `user settings (dune.com) -> data -> delete`.
2121

2222
If you have larger datasets you want to upload, please [contact us here](https://docs.google.com/forms/d/e/1FAIpQLSekx61WzIh-MII18zRj1G98aJeLM7U0VEBqaa6pVk_DQ7lq6Q/viewform)

0 commit comments

Comments
 (0)