Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/airbytehq/airbyte into cm…
Browse files Browse the repository at this point in the history
…m-airbyte/fb_oauth
  • Loading branch information
cristina.mariscal authored and cristina.mariscal committed Jun 6, 2024
2 parents c476c0a + a1b5506 commit eb8b13f
Show file tree
Hide file tree
Showing 413 changed files with 8,040 additions and 5,353 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.62.0
current_version = 0.62.1
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-[a-z]+)?
Expand Down
1 change: 1 addition & 0 deletions airbyte-cdk/java/airbyte-cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ corresponds to that version.

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-----------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0.36.6 | 2024-06-05 | [\#39106](https://github.com/airbytehq/airbyte/pull/39106) | Skip write to storage with 0 byte file |
| 0.36.5 | 2024-06-01 | [\#38792](https://github.com/airbytehq/airbyte/pull/38792) | Throw config exception if no selectable table exists in user provided schemas |
| 0.36.4 | 2024-05-31 | [\#38824](https://github.com/airbytehq/airbyte/pull/38824) | Param marked as non-null to nullable in JdbcDestinationHandler for NPE fix |
| 0.36.2 | 2024-05-29 | [\#38538](https://github.com/airbytehq/airbyte/pull/38357) | Exit connector when encountering a config error. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.36.5
version=0.36.6
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ class StagingStreamOperations<DestinationState : MinimumDestinationState>(
log.info {
"Buffer flush complete for stream ${streamConfig.id.originalName} (${FileUtils.byteCountToDisplaySize(it.byteCount)}) to staging"
}
storageOperation.writeToStage(streamConfig, writeBuffer)
if (it.byteCount != 0L) {
storageOperation.writeToStage(streamConfig, writeBuffer)
} else {
log.info { "Skipping writing to storage since there are no bytes to write" }
}
}
}
}
6 changes: 6 additions & 0 deletions airbyte-cdk/python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.3.1
Use for Jinja interpolations

## 1.3.0
Added new datetime format: %s_as_float

## 1.2.1
Python 3.11 compatibility bugfixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def parse(self, date: Union[str, int], format: str) -> datetime.datetime:
# See https://stackoverflow.com/a/4974930
if format == "%s":
return datetime.datetime.fromtimestamp(int(date), tz=datetime.timezone.utc)
elif format == "%s_as_float":
return datetime.datetime.fromtimestamp(float(date), tz=datetime.timezone.utc)
elif format == "%ms":
return self._UNIX_EPOCH + datetime.timedelta(milliseconds=int(date))

Expand All @@ -41,6 +43,8 @@ def format(self, dt: datetime.datetime, format: str) -> str:
# See https://stackoverflow.com/a/4974930
if format == "%s":
return str(int(dt.timestamp()))
if format == "%s_as_float":
return str(float(dt.timestamp()))
if format == "%ms":
# timstamp() returns a float representing the number of seconds since the unix epoch
return str(int(dt.timestamp() * 1000))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ definitions:
description: |
The datetime format used to format the datetime values that are sent in outgoing requests to the API. Use placeholders starting with "%" to describe the format the API is using. The following placeholders are available:
* **%s**: Epoch unix timestamp - `1686218963`
* **%s_as_float**: Epoch unix timestamp in seconds as float with microsecond precision - `1686218963.123456`
* **%ms**: Epoch unix timestamp (milliseconds) - `1686218963123`
* **%a**: Weekday (abbreviated) - `Sun`
* **%A**: Weekday (full) - `Sunday`
Expand Down Expand Up @@ -752,6 +753,7 @@ definitions:
- "%Y-%m-%d"
- "%s"
- "%ms"
- "%s_as_float"
start_datetime:
title: Start Datetime
description: The datetime that determines the earliest record that should be synced.
Expand Down Expand Up @@ -1717,6 +1719,7 @@ definitions:
description: |
Format of the datetime value. Defaults to "%Y-%m-%dT%H:%M:%S.%f%z" if left empty. Use placeholders starting with "%" to describe the format the API is using. The following placeholders are available:
* **%s**: Epoch unix timestamp - `1686218963`
* **%s_as_float**: Epoch unix timestamp in seconds as float with microsecond precision - `1686218963.123456`
* **%ms**: Epoch unix timestamp - `1686218963123`
* **%a**: Weekday (abbreviated) - `Sun`
* **%A**: Weekday (full) - `Sunday`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from airbyte_cdk.sources.types import Config
from jinja2 import meta
from jinja2.exceptions import UndefinedError
from jinja2.sandbox import Environment
from jinja2.sandbox import SandboxedEnvironment


class JinjaInterpolation(Interpolation):
Expand Down Expand Up @@ -49,7 +49,7 @@ class JinjaInterpolation(Interpolation):
RESTRICTED_BUILTIN_FUNCTIONS = ["range"] # The range function can cause very expensive computations

def __init__(self) -> None:
self._environment = Environment()
self._environment = SandboxedEnvironment()
self._environment.filters.update(**filters)
self._environment.globals.update(**macros)

Expand Down
76 changes: 0 additions & 76 deletions airbyte-cdk/python/bin/remove-default-paginator-url-base.py

This file was deleted.

2 changes: 1 addition & 1 deletion airbyte-cdk/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "airbyte-cdk"
version = "1.2.1"
version = "1.3.1"
description = "A framework for writing Airbyte Connectors."
authors = ["Airbyte <contact@airbyte.io>"]
license = "MIT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
datetime.datetime(2021, 1, 1, 0, 0, tzinfo=datetime.timezone.utc),
),
(
"test_parse_timestamp",
"test_parse_timestamp_as_float",
"1675092508.873709",
"%s_as_float",
datetime.datetime(2023, 1, 30, 15, 28, 28, 873709, tzinfo=datetime.timezone.utc),
),
(
"test_parse_ms_timestamp",
"1609459200001",
"%ms",
datetime.datetime(2021, 1, 1, 0, 0, 0, 1000, tzinfo=datetime.timezone.utc),
Expand All @@ -49,6 +55,7 @@ def test_parse_date(test_name, input_date, date_format, expected_output_date):
[
("test_format_timestamp", datetime.datetime(2021, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), "%s", "1609459200"),
("test_format_timestamp_ms", datetime.datetime(2021, 1, 1, 0, 0, 0, 1000, tzinfo=datetime.timezone.utc), "%ms", "1609459200001"),
("test_format_timestamp_as_float", datetime.datetime(2023, 1, 30, 15, 28, 28, 873709, tzinfo=datetime.timezone.utc), "%s_as_float", "1675092508.873709"),
("test_format_string", datetime.datetime(2021, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), "%Y-%m-%d", "2021-01-01"),
("test_format_to_number", datetime.datetime(2021, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), "%Y%m%d", "20210101"),
],
Expand Down
17 changes: 9 additions & 8 deletions airbyte-ci/connectors/base_images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ However, we do artificially generate Dockerfiles for debugging and documentation

### Example for `airbyte/python-connector-base`:
```dockerfile
FROM docker.io/python:3.9.19-slim-bookworm@sha256:b92e6f45b58d9cafacc38563e946f8d249d850db862cbbd8befcf7f49eef8209
FROM docker.io/python:3.9.19-slim-bookworm@sha256:088d9217202188598aac37f8db0929345e124a82134ac66b8bb50ee9750b045b
RUN ln -snf /usr/share/zoneinfo/Etc/UTC /etc/localtime
RUN pip install --upgrade pip==24.0 setuptools==70.0.0
ENV POETRY_VIRTUALENVS_CREATE=false
Expand All @@ -38,13 +38,14 @@ RUN mkdir /usr/share/nltk_data

### `airbyte/python-connector-base`

| Version | Published | Docker Image Address | Changelog |
| ---------- | --------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| 1.2.1 || docker.io/airbyte/python-connector-base:1.2.1@sha256:4a4255e2bccab71fa5912487e42d9755cdecffae77273fed8be01a081cd6e795 | Upgrade to Python 3.9.19 + update pip and setuptools |
| 1.2.0 || docker.io/airbyte/python-connector-base:1.2.0@sha256:c22a9d97464b69d6ef01898edf3f8612dc11614f05a84984451dde195f337db9 | Add CDK system dependencies: nltk data, tesseract, poppler. |
| 1.2.0-rc.1 || docker.io/airbyte/python-connector-base:1.2.0-rc.1@sha256:f6467768b75fb09125f6e6b892b6b48c98d9fe085125f3ff4adc722afb1e5b30 | |
| 1.1.0 || docker.io/airbyte/python-connector-base:1.1.0@sha256:bd98f6505c6764b1b5f99d3aedc23dfc9e9af631a62533f60eb32b1d3dbab20c | Install socat |
| 1.0.0 || docker.io/airbyte/python-connector-base:1.0.0@sha256:dd17e347fbda94f7c3abff539be298a65af2d7fc27a307d89297df1081a45c27 | Initial release: based on Python 3.9.18, on slim-bookworm system, with pip==23.2.1 and poetry==1.6.1 |
| Version | Published | Docker Image Address | Changelog |
|---------|-----------|--------------|-----------|
| 1.2.2 || docker.io/airbyte/python-connector-base:1.2.2@sha256:57703de3b4c4204bd68a7b13c9300f8e03c0189bffddaffc796f1da25d2dbea0 | Fix Python 3.9.19 image digest |
| 1.2.1 || docker.io/airbyte/python-connector-base:1.2.1@sha256:4a4255e2bccab71fa5912487e42d9755cdecffae77273fed8be01a081cd6e795 | Upgrade to Python 3.9.19 + update pip and setuptools |
| 1.2.0 || docker.io/airbyte/python-connector-base:1.2.0@sha256:c22a9d97464b69d6ef01898edf3f8612dc11614f05a84984451dde195f337db9 | Add CDK system dependencies: nltk data, tesseract, poppler. |
| 1.2.0-rc.1 || docker.io/airbyte/python-connector-base:1.2.0-rc.1@sha256:f6467768b75fb09125f6e6b892b6b48c98d9fe085125f3ff4adc722afb1e5b30 | |
| 1.1.0 || docker.io/airbyte/python-connector-base:1.1.0@sha256:bd98f6505c6764b1b5f99d3aedc23dfc9e9af631a62533f60eb32b1d3dbab20c | Install socat |
| 1.0.0 || docker.io/airbyte/python-connector-base:1.0.0@sha256:dd17e347fbda94f7c3abff539be298a65af2d7fc27a307d89297df1081a45c27 | Initial release: based on Python 3.9.18, on slim-bookworm system, with pip==23.2.1 and poetry==1.6.1 |


## How to release a new base image version (example for Python)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
registry="docker.io",
repository="python",
tag="3.9.19-slim-bookworm",
sha="b92e6f45b58d9cafacc38563e946f8d249d850db862cbbd8befcf7f49eef8209",
sha="088d9217202188598aac37f8db0929345e124a82134ac66b8bb50ee9750b045b",
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[
{
"version": "1.2.2",
"changelog_entry": "Fix Python 3.9.19 image digest",
"dockerfile_example": "FROM docker.io/python:3.9.19-slim-bookworm@sha256:088d9217202188598aac37f8db0929345e124a82134ac66b8bb50ee9750b045b\nRUN ln -snf /usr/share/zoneinfo/Etc/UTC /etc/localtime\nRUN pip install --upgrade pip==24.0 setuptools==70.0.0\nENV POETRY_VIRTUALENVS_CREATE=false\nENV POETRY_VIRTUALENVS_IN_PROJECT=false\nENV POETRY_NO_INTERACTION=1\nRUN pip install poetry==1.6.1\nRUN sh -c apt update && apt-get install -y socat=1.7.4.4-2\nRUN sh -c apt-get update && apt-get install -y tesseract-ocr=5.3.0-2 poppler-utils=22.12.0-2+b1\nRUN mkdir /usr/share/nltk_data"
},
{
"version": "1.2.1",
"changelog_entry": "Upgrade to Python 3.9.19 + update pip and setuptools",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: api
connectorType: destination
definitionId: 0eeee7fb-518f-4045-bacc-9619e31c43ea
dockerImageTag: 0.1.3
dockerImageTag: 0.1.4
dockerRepository: airbyte/destination-amazon-sqs
githubIssueLabel: destination-amazon-sqs
icon: awssqs.svg
Expand Down Expand Up @@ -35,5 +35,5 @@ data:
type: GSM
alias: airbyte-connector-testing-secret-store
connectorBuildOptions:
baseImage: docker.io/airbyte/python-connector-base:1.2.0@sha256:c22a9d97464b69d6ef01898edf3f8612dc11614f05a84984451dde195f337db9
baseImage: docker.io/airbyte/python-connector-base:1.2.2@sha256:57703de3b4c4204bd68a7b13c9300f8e03c0189bffddaffc796f1da25d2dbea0
metadataSpecVersion: "1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.1.3"
version = "0.1.4"
name = "destination-amazon-sqs"
description = "Destination implementation for Amazon Sqs."
authors = [ "Airbyte <contact@airbyte.io>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def find_documents(

if include_vector is not None and include_vector == False:
find_query["projection"] = {"$vector": 0}
else:
find_query["projection"] = {"*": 1}

if limit is not None:
find_query["options"] = {"limit": limit}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data:
connectorSubtype: database
connectorType: destination
definitionId: 042ce96f-1158-4662-9543-e2ff015be97a
dockerImageTag: 0.1.3
dockerImageTag: 0.1.4
dockerRepository: airbyte/destination-astra
githubIssueLabel: destination-astra
icon: astra.svg
Expand Down
Loading

0 comments on commit eb8b13f

Please sign in to comment.