From 97ceaedc4e12a2e78091ea89f3fabd088a2282dc Mon Sep 17 00:00:00 2001 From: btkcodedev Date: Fri, 24 May 2024 00:41:10 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Source=20Open=20Weather:=20Make=20Conn?= =?UTF-8?q?ector=20Compatible=20with=20Builder=20(#38601)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Natik Gadzhi --- .../source-openweather/metadata.yaml | 2 +- .../source-openweather/pyproject.toml | 2 +- .../source-openweather/requirements.txt | 2 - .../source_openweather/manifest.yaml | 405 +++++++++--------- docs/integrations/sources/openweather.md | 1 + 5 files changed, 196 insertions(+), 216 deletions(-) delete mode 100644 airbyte-integrations/connectors/source-openweather/requirements.txt diff --git a/airbyte-integrations/connectors/source-openweather/metadata.yaml b/airbyte-integrations/connectors/source-openweather/metadata.yaml index 583b1e8626bf..2b2dd0d97c02 100644 --- a/airbyte-integrations/connectors/source-openweather/metadata.yaml +++ b/airbyte-integrations/connectors/source-openweather/metadata.yaml @@ -7,7 +7,7 @@ data: connectorSubtype: api connectorType: source definitionId: 561d7787-b45e-4f3b-af58-0163c3ba9d5a - dockerImageTag: 0.2.3 + dockerImageTag: 0.2.4 dockerRepository: airbyte/source-openweather documentationUrl: https://docs.airbyte.com/integrations/sources/openweather githubIssueLabel: source-openweather diff --git a/airbyte-integrations/connectors/source-openweather/pyproject.toml b/airbyte-integrations/connectors/source-openweather/pyproject.toml index 14c45ff6e4be..c4a46deb973c 100644 --- a/airbyte-integrations/connectors/source-openweather/pyproject.toml +++ b/airbyte-integrations/connectors/source-openweather/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] build-backend = "poetry.core.masonry.api" [tool.poetry] -version = "0.2.3" +version = "0.2.4" name = "source-openweather" description = "Source implementation for Openweather." authors = [ "Airbyte ",] diff --git a/airbyte-integrations/connectors/source-openweather/requirements.txt b/airbyte-integrations/connectors/source-openweather/requirements.txt deleted file mode 100644 index cc57334ef619..000000000000 --- a/airbyte-integrations/connectors/source-openweather/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ --e ../../bases/connector-acceptance-test --e . diff --git a/airbyte-integrations/connectors/source-openweather/source_openweather/manifest.yaml b/airbyte-integrations/connectors/source-openweather/source_openweather/manifest.yaml index 10fd36d3787c..e33277c286fa 100644 --- a/airbyte-integrations/connectors/source-openweather/source_openweather/manifest.yaml +++ b/airbyte-integrations/connectors/source-openweather/source_openweather/manifest.yaml @@ -1,234 +1,80 @@ -version: "0.29.0" +version: 0.79.1 -definitions: - selector: - type: RecordSelector - extractor: - type: DpathExtractor - field_path: [] - - requester: - type: HttpRequester - url_base: "https://api.openweathermap.org/data/3.0/" - http_method: "GET" - request_parameters: - lat: - "{% if -90.00 <= config['lat']|float <= 90.00 %}{{ config['lat'] }}{% else - %} WRONG LATITUDE{% endif %}" - lon: - "{% if -180.00 <= config['lon']|float <= 180.00 %}{{ config['lon'] }}{% - else %}WRONG LONGITUDE{% endif %}" - appid: "{{ config['appid'] }}" - lang: "{{ config.get('lang')}}" - units: "{{ config.get('units')}}" - error_handler: - response_filters: - - http_codes: [500] - action: RETRY - retriever: - type: SimpleRetriever - record_selector: - $ref: "#/definitions/selector" - paginator: - type: NoPagination - requester: - $ref: "#/definitions/requester" - base_stream: - type: DeclarativeStream - retriever: - $ref: "#/definitions/retriever" - # incremental_sync_base: - # type: DatetimeBasedCursor - # cursor_field: "sync_field" - # datetime_format: "%s" - # cursor_granularity: "PT0.000001S" - # lookback_window: "P5D" - # start_datetime: - # datetime: "{{ config['dt'] }}" - # datetime_format: "%s" - # end_datetime: - # datetime: "{{ format_datetime(now_utc(), '%s') }}" - # datetime_format: "%s" - # step: "P1M" - - onecall_stream: - $ref: "#/definitions/base_stream" - name: "onecall" - retriever: - $ref: "#/definitions/retriever" - $parameters: - path: "onecall" - # the commented section is for incremental sync which is not supported by the API - # path: "{% if config['dt']%}onecall/timemachine{% else %}onecall{% endif %}" - # transformations: - # - type: AddFields - # fields: - # - path: [ "sync_field" ] - # value: "{{ record['current']['dt'] }}" - # incremental_cursor: ["current","dt"] - # incremental_sync: - # $ref: "#/definitions/incremental_sync_base" - - schema_loader: - type: InlineSchemaLoader - schema: - $schema: http://json-schema.org/draft-07/schema# - type: object - additionalProperties: true - properties: - lat: - description: Latitude of the requested location - type: number - lon: - description: Longitude of the requested location - type: number - timezone: - description: Time zone name for the requested location - type: string - timezone_offset: - description: Time offset in seconds from UTC - type: number - current: - description: Contains current weather data - type: object - additionalProperties: true - properties: - dt: - description: Time of the data forecasted - type: number - sunrise: - description: Sunrise time - type: number - sunset: - description: Sunset time - type: number - temp: - description: Temperature - type: number - feels_like: - description: Apparent (feels like) temperature - type: number - pressure: - description: Atmospheric pressure on the sea level - type: number - humidity: - description: Humidity percentage - type: number - dew_point: - description: Dew point temperature - type: number - uvi: - description: UV index - type: number - clouds: - description: Cloudiness percentage - type: number - visibility: - description: Visibility distance - type: number - wind_speed: - description: Wind speed in meters per second - type: number - wind_deg: - description: Wind direction in degrees - type: number - weather: - description: Weather condition - type: array - rain: - description: Information about precipitation in the last hour - type: object - additionalProperties: true - properties: - 1h: - description: Rain volume for the last hour - type: number - minutely: - description: Minute forecast for the next hour - type: array - hourly: - description: Weather forecast for the next 48 hours - type: array - daily: - description: Weather forecast for the next 7 days - type: array - alerts: - description: Weather alerts for the requested location - type: array -streams: - - "#/definitions/onecall_stream" +type: DeclarativeSource check: type: CheckStream stream_names: - - "onecall" + - onecall + +definitions: + streams: + onecall: + type: DeclarativeStream + name: onecall + retriever: + type: SimpleRetriever + requester: + $ref: "#/definitions/base_requester" + path: onecall + http_method: GET + request_parameters: + lat: >- + {% if -90.00 <= config['lat']|float <= 90.00 %}{{ config['lat'] + }}{% else %} WRONG LATITUDE{% endif %} + lon: >- + {% if -180.00 <= config['lon']|float <= 180.00 %}{{ config['lon'] + }}{% else %}WRONG LONGITUDE{% endif %} + appid: "{{ config['appid'] }}" + lang: "{{ config.get('lang')}}" + units: "{{ config.get('units')}}" + error_handler: + type: CompositeErrorHandler + error_handlers: + - type: DefaultErrorHandler + response_filters: + - type: HttpResponseFilter + http_codes: + - 500 + action: RETRY + record_selector: + type: RecordSelector + extractor: + type: DpathExtractor + field_path: [] + schema_loader: + type: InlineSchemaLoader + schema: + $ref: "#/schemas/onecall" + base_requester: + type: HttpRequester + url_base: https://api.openweathermap.org/data/3.0/ + +streams: + - $ref: "#/definitions/streams/onecall" spec: type: Spec - documentation_url: https://docs.airbyte.com/integrations/sources/openweather connection_specification: - title: Openweather Spec type: object + $schema: http://json-schema.org/draft-07/schema# required: + - appid - lat - lon - - appid - additionalProperties: true properties: - lat: - type: string - pattern: "^[-]?\\d{1,2}(\\.\\d+)?$" - description: - "Latitude, decimal (-90; 90). If you need the geocoder to automatic - convert city names and zip-codes to geo coordinates and the other way around, - please use our Geocoding API" - examples: - - "45.7603" - - "-21.249107858038816" - lon: - type: string - pattern: "^[-]?\\d{1,2}(\\.\\d+)?$" - description: - "Longitude, decimal (-180; 180). If you need the geocoder to - automatic convert city names and zip-codes to geo coordinates and the other - way around, please use our Geocoding API" - examples: - - "4.835659" - - "-70.39482074115321" appid: type: string - description: "API KEY" + description: API KEY airbyte_secret: true - units: - type: string - description: - "Units of measurement. standard, metric and imperial units are - available. If you do not use the units parameter, standard units will be - applied by default." - enum: - - standard - - metric - - imperial - examples: - - "standard" - - "metric" - - "imperial" - # dt: - # type: string - # description : "Date in UNIX format" - # example: - # - '1693023447' - only_current: - type: boolean - description: "True for particular day" - example: - - "true" + order: 0 lang: type: string - description: - You can use lang parameter to get the output in your language. - The contents of the description field will be translated. See here - for the list of supported languages. + description: >- + You can use lang parameter to get the output in your language. The + contents of the description field will be translated. See here for + the list of supported languages. enum: - af - al @@ -286,3 +132,138 @@ spec: - uk - zh_cn - zh_tw + order: 1 + lat: + type: string + pattern: ^[-]?\d{1,2}(\.\d+)?$ + description: >- + Latitude, decimal (-90; 90). If you need the geocoder to automatic + convert city names and zip-codes to geo coordinates and the other way + around, please use our Geocoding API + examples: + - "45.7603" + - "-21.249107858038816" + order: 2 + lon: + type: string + pattern: ^[-]?\d{1,2}(\.\d+)?$ + description: >- + Longitude, decimal (-180; 180). If you need the geocoder to automatic + convert city names and zip-codes to geo coordinates and the other way + around, please use our Geocoding API + examples: + - "4.835659" + - "-70.39482074115321" + order: 3 + only_current: + type: boolean + description: True for particular day + example: + - "true" + order: 4 + units: + type: string + description: >- + Units of measurement. standard, metric and imperial units are + available. If you do not use the units parameter, standard units will + be applied by default. + enum: + - standard + - metric + - imperial + examples: + - standard + - metric + - imperial + order: 5 + additionalProperties: true + +metadata: + autoImportSchema: + onecall: false + +schemas: + onecall: + type: object + $schema: http://json-schema.org/draft-07/schema# + additionalProperties: true + properties: + alerts: + type: array + description: Weather alerts for the requested location + current: + type: object + additionalProperties: true + description: Contains current weather data + properties: + clouds: + type: number + description: Cloudiness percentage + dew_point: + type: number + description: Dew point temperature + dt: + type: number + description: Time of the data forecasted + feels_like: + type: number + description: Apparent (feels like) temperature + humidity: + type: number + description: Humidity percentage + pressure: + type: number + description: Atmospheric pressure on the sea level + rain: + type: object + additionalProperties: true + description: Information about precipitation in the last hour + properties: + 1h: + type: number + description: Rain volume for the last hour + sunrise: + type: number + description: Sunrise time + sunset: + type: number + description: Sunset time + temp: + type: number + description: Temperature + uvi: + type: number + description: UV index + visibility: + type: number + description: Visibility distance + weather: + type: array + description: Weather condition + wind_deg: + type: number + description: Wind direction in degrees + wind_speed: + type: number + description: Wind speed in meters per second + daily: + type: array + description: Weather forecast for the next 7 days + hourly: + type: array + description: Weather forecast for the next 48 hours + lat: + type: number + description: Latitude of the requested location + lon: + type: number + description: Longitude of the requested location + minutely: + type: array + description: Minute forecast for the next hour + timezone: + type: string + description: Time zone name for the requested location + timezone_offset: + type: number + description: Time offset in seconds from UTC diff --git a/docs/integrations/sources/openweather.md b/docs/integrations/sources/openweather.md index 86f532e74429..7dcc660c82c8 100644 --- a/docs/integrations/sources/openweather.md +++ b/docs/integrations/sources/openweather.md @@ -35,6 +35,7 @@ The free plan allows 60 calls per minute and 1,000,000 calls per month, you won' | Version | Date | Pull Request | Subject | | :------ | :--------- | :------------------------------------------------------- | :------------------------------------------------------------------------------ | +| 0.2.4 | 2024-05-25 | [38601](https://github.com/airbytehq/airbyte/pull/38601) | Make compatible with the builder. | | 0.2.3 | 2024-04-19 | [37209](https://github.com/airbytehq/airbyte/pull/37209) | Upgrade to CDK 0.80.0 and manage dependencies with Poetry. | | 0.2.2 | 2024-04-15 | [37209](https://github.com/airbytehq/airbyte/pull/37209) | Base image migration: remove Dockerfile and use the python-connector-base image | | 0.2.1 | 2024-04-12 | [37209](https://github.com/airbytehq/airbyte/pull/37209) | schema descriptions |