-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source Greenhouse: unpin CDK #35988
Source Greenhouse: unpin CDK #35988
Changes from 4 commits
50f275f
2a5af03
079a8e7
fcb5cc0
3d7eeb1
4defee5
9c99c45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] | |
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry] | ||
version = "0.5.0" | ||
version = "0.5.1" | ||
name = "source-greenhouse" | ||
description = "Source implementation for Greenhouse." | ||
authors = [ "Airbyte <[email protected]>",] | ||
|
@@ -17,7 +17,7 @@ include = "source_greenhouse" | |
|
||
[tool.poetry.dependencies] | ||
python = "^3.9,<3.12" | ||
airbyte-cdk = "==0.63.2" | ||
airbyte-cdk = "^0" | ||
dataclasses-jsonschema = "==2.15.1" | ||
|
||
[tool.poetry.scripts] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,8 @@ def __post_init__(self, parameters: Mapping[str, Any]): | |
self._state = {} | ||
|
||
def stream_slices(self) -> Iterable[StreamSlice]: | ||
yield {self.request_cursor_field: self._state.get(self.cursor_field, self.START_DATETIME)} | ||
slice = StreamSlice(partition={}, cursor_slice={self.request_cursor_field: self._state.get(self.cursor_field, self.START_DATETIME)}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: if we're only yielding one slice in the subsequent line, can we just do this in one line instead There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done 👍 |
||
yield slice | ||
|
||
def _max_dt_str(self, *args: str) -> Optional[str]: | ||
new_state_candidates = list(map(lambda x: datetime.datetime.strptime(x, self.DATETIME_FORMAT), filter(None, args))) | ||
|
@@ -109,11 +110,14 @@ def stream_slices(self) -> Iterable[StreamSlice]: | |
sync_mode=SyncMode.full_refresh, cursor_field=None, stream_slice=parent_stream_slice, stream_state=None | ||
): | ||
parent_state_value = parent_record.get(self.parent_key) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if there is no There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Took another look, and now realizing the variable name is a bit misleading. This is set to the value of the current parent record's primary key, so we can assume it always exists. I've updated the variable name to |
||
yield { | ||
self.stream_slice_field: parent_state_value, | ||
self.request_cursor_field: self._state.get(str(parent_state_value), {}).get(self.cursor_field, self.START_DATETIME), | ||
|
||
partition = {self.stream_slice_field: parent_state_value} | ||
cursor_slice = { | ||
self.request_cursor_field: self._state.get(str(parent_state_value), {}).get(self.cursor_field, self.START_DATETIME) | ||
} | ||
|
||
yield StreamSlice(partition=partition, cursor_slice=cursor_slice) | ||
|
||
def set_initial_state(self, stream_state: StreamState) -> None: | ||
if self.stream_slice_field in stream_state: | ||
return | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: "0.29.0" | ||
version: "0.70.0" | ||
|
||
definitions: | ||
schema_loader: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to use ">=0.63.2", but not blocking on this one.