Skip to content

Commit

Permalink
Update links (#24100)
Browse files Browse the repository at this point in the history
* Update links

* Add missing files
  • Loading branch information
girarda authored Mar 15, 2023
1 parent e9a21d6 commit 9864e4b
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ See the [catalog guide](https://docs.airbyte.com/understanding-airbyte/beginners

Let's define the stream schema in `source-exchange-rates-tutorial/source_exchange_rates_tutorial/schemas/rates.json`

You can download the JSON file describing the output schema with all currencies [here](https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-cdk/python/docs/tutorials/http_api_source_assets/exchange_rates.json) for convenience and place it in `schemas/`.
You can download the JSON file describing the output schema with all currencies [here](../../tutorials/cdk-tutorial-python-http/exchange_rates_schema.json) for convenience and place it in `schemas/`.

```bash
curl https://raw.githubusercontent.com/airbytehq/airbyte/master/airbyte-cdk/python/docs/tutorials/http_api_source_assets/exchange_rates.json > source_exchange_rates_tutorial/schemas/rates.json
curl https://raw.githubusercontent.com/airbytehq/airbyte/master/docs/connector-development/tutorials/cdk-tutorial-python-http/exchange_rates_schema.json > source_exchange_rates_tutorial/schemas/rates.json
```

We can also delete the boilerplate schema files
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"streams": [
{
"stream": {
"name": "exchange_rates",
"json_schema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"access_key": {
"type": "string"
},
"base": {
"type": "string"
},
"rates": {
"type": "object",
"properties": {
"GBP": {
"type": "number"
},
"HKD": {
"type": "number"
},
"IDR": {
"type": "number"
},
"PHP": {
"type": "number"
},
"LVL": {
"type": "number"
},
"INR": {
"type": "number"
},
"CHF": {
"type": "number"
},
"MXN": {
"type": "number"
},
"SGD": {
"type": "number"
},
"CZK": {
"type": "number"
},
"THB": {
"type": "number"
},
"BGN": {
"type": "number"
},
"EUR": {
"type": "number"
},
"MYR": {
"type": "number"
},
"NOK": {
"type": "number"
},
"CNY": {
"type": "number"
},
"HRK": {
"type": "number"
},
"PLN": {
"type": "number"
},
"LTL": {
"type": "number"
},
"TRY": {
"type": "number"
},
"ZAR": {
"type": "number"
},
"CAD": {
"type": "number"
},
"BRL": {
"type": "number"
},
"RON": {
"type": "number"
},
"DKK": {
"type": "number"
},
"NZD": {
"type": "number"
},
"EEK": {
"type": "number"
},
"JPY": {
"type": "number"
},
"RUB": {
"type": "number"
},
"KRW": {
"type": "number"
},
"USD": {
"type": "number"
},
"AUD": {
"type": "number"
},
"HUF": {
"type": "number"
},
"SEK": {
"type": "number"
}
}
},
"date": {
"type": "string"
}
}
},
"supported_sync_modes": ["full_refresh"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SourcePythonHttpTutorial(AbstractSource):
return [ExchangeRates(authenticator=auth)]
```

Having created this stream in code, we'll put a file `exchange_rates.json` in the `schemas/` folder. You can download the JSON file describing the output schema [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-cdk/python/docs/tutorials/http_api_source_assets/exchange_rates.json) for convenience and place it in `schemas/`.
Having created this stream in code, we'll put a file `exchange_rates.json` in the `schemas/` folder. You can download the JSON file describing the output schema [here](./exchange_rates_schema.json) for convenience and place it in `schemas/`.

With `.json` schema file in place, let's see if the connector can now find this schema and produce a valid catalog:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"type": "object",
"required": ["base", "date", "rates"],
"properties": {
"access_key": {
"type": "string"
},
"base": {
"type": "string"
},
"date": {
"type": "string"
},
"rates": {
"type": "object",
"properties": {
"CAD": {
"type": ["null", "number"]
},
"HKD": {
"type": ["null", "number"]
},
"ISK": {
"type": ["null", "number"]
},
"PHP": {
"type": ["null", "number"]
},
"DKK": {
"type": ["null", "number"]
},
"HUF": {
"type": ["null", "number"]
},
"CZK": {
"type": ["null", "number"]
},
"GBP": {
"type": ["null", "number"]
},
"RON": {
"type": ["null", "number"]
},
"SEK": {
"type": ["null", "number"]
},
"IDR": {
"type": ["null", "number"]
},
"INR": {
"type": ["null", "number"]
},
"BRL": {
"type": ["null", "number"]
},
"RUB": {
"type": ["null", "number"]
},
"HRK": {
"type": ["null", "number"]
},
"JPY": {
"type": ["null", "number"]
},
"THB": {
"type": ["null", "number"]
},
"CHF": {
"type": ["null", "number"]
},
"EUR": {
"type": ["null", "number"]
},
"MYR": {
"type": ["null", "number"]
},
"BGN": {
"type": ["null", "number"]
},
"TRY": {
"type": ["null", "number"]
},
"CNY": {
"type": ["null", "number"]
},
"NOK": {
"type": ["null", "number"]
},
"NZD": {
"type": ["null", "number"]
},
"ZAR": {
"type": ["null", "number"]
},
"USD": {
"type": ["null", "number"]
},
"MXN": {
"type": ["null", "number"]
},
"SGD": {
"type": ["null", "number"]
},
"AUD": {
"type": ["null", "number"]
},
"ILS": {
"type": ["null", "number"]
},
"KRW": {
"type": ["null", "number"]
},
"PLN": {
"type": ["null", "number"]
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Let's also pass the config specified by the user to the stream class:

We're now ready to query the API!

To do this, we'll need a [ConfiguredCatalog](../../../understanding-airbyte/beginners-guide-to-catalog.md). We've prepared one [here](https://github.com/airbytehq/airbyte/blob/master/airbyte-cdk/python/docs/tutorials/http_api_source_assets/configured_catalog.json) -- download this and place it in `sample_files/configured_catalog.json`. Then run:
To do this, we'll need a [ConfiguredCatalog](../../../understanding-airbyte/beginners-guide-to-catalog.md). We've prepared one [here](https://github.com/airbytehq/airbyte/blob/master/docs/connector-development/tutorials/cdk-tutorial-python-http/configured_catalog.json) -- download this and place it in `sample_files/configured_catalog.json`. Then run:

```text
python main.py read --config secrets/config.json --catalog sample_files/configured_catalog.json
Expand Down

0 comments on commit 9864e4b

Please sign in to comment.