From a1de8f236185e8e3c31fc1233cb81656a8bab463 Mon Sep 17 00:00:00 2001 From: LiRen Tu Date: Sat, 4 Sep 2021 11:17:13 -0700 Subject: [PATCH] Format code and add missing doc links (#5847) * Fix format * Fix documentation links * Add missing documentation --- .../unit_tests/test_utils.py | 132 +++++++++--------- .../source-facebook-pages/README.md | 2 +- .../acceptance-test-config.yml | 2 +- .../source-slack/source_slack/source.py | 4 +- docs/deploying-airbyte/on-kubernetes.md | 3 +- docs/integrations/sources/facebook-pages.md | 7 + 6 files changed, 80 insertions(+), 70 deletions(-) create mode 100644 docs/integrations/sources/facebook-pages.md diff --git a/airbyte-integrations/bases/source-acceptance-test/unit_tests/test_utils.py b/airbyte-integrations/bases/source-acceptance-test/unit_tests/test_utils.py index ecfec41c5b40..ad361703c786 100644 --- a/airbyte-integrations/bases/source-acceptance-test/unit_tests/test_utils.py +++ b/airbyte-integrations/bases/source-acceptance-test/unit_tests/test_utils.py @@ -28,74 +28,78 @@ @pytest.fixture(name="not_sorted_data") def not_sorted_data_fixture(): - return [{ - "date_created": "0001-01-01T00:00:00", - "date_updated": "0001-01-01T00:00:00", - "editable": False, - "id": "superuser", - "name": "Super User", - "organization_id": "orga_ya3w9oMjeLtWe7zFGZr63Dz8ruBbjybG0EIUdUXaESi", - "permissions": [ - "bulk_edit", - "delete_own_opportunities", - "export", - "manage_group_numbers", - "manage_email_sequences", - "delete_leads", - "call_coach_listen", - "call_coach_barge", - "manage_others_tasks", - "manage_others_activities", - "delete_own_tasks", - "manage_customizations", - "manage_team_smart_views", - "bulk_delete", - "manage_team_email_templates", - "bulk_email", - "merge_leads", - "calling", - "bulk_sequence_subscriptions", - "bulk_import", - "delete_own_activities", - "manage_others_opportunities" - ] - }] + return [ + { + "date_created": "0001-01-01T00:00:00", + "date_updated": "0001-01-01T00:00:00", + "editable": False, + "id": "superuser", + "name": "Super User", + "organization_id": "orga_ya3w9oMjeLtWe7zFGZr63Dz8ruBbjybG0EIUdUXaESi", + "permissions": [ + "bulk_edit", + "delete_own_opportunities", + "export", + "manage_group_numbers", + "manage_email_sequences", + "delete_leads", + "call_coach_listen", + "call_coach_barge", + "manage_others_tasks", + "manage_others_activities", + "delete_own_tasks", + "manage_customizations", + "manage_team_smart_views", + "bulk_delete", + "manage_team_email_templates", + "bulk_email", + "merge_leads", + "calling", + "bulk_sequence_subscriptions", + "bulk_import", + "delete_own_activities", + "manage_others_opportunities", + ], + } + ] @pytest.fixture(name="sorted_data") def sorted_data_fixture(): - return [{ - "date_created": "0001-01-01T00:00:00", - "date_updated": "0001-01-01T00:00:00", - "editable": False, - "id": "superuser", - "name": "Super User", - "organization_id": "orga_ya3w9oMjeLtWe7zFGZr63Dz8ruBbjybG0EIUdUXaESi", - "permissions": [ - "bulk_delete", - "bulk_edit", - "bulk_email", - "bulk_import", - "bulk_sequence_subscriptions", - "call_coach_barge", - "call_coach_listen", - "calling", - "delete_leads", - "delete_own_activities", - "delete_own_opportunities", - "delete_own_tasks", - "export", - "manage_customizations", - "manage_email_sequences", - "manage_group_numbers", - "manage_others_activities", - "manage_others_opportunities", - "manage_others_tasks", - "manage_team_email_templates", - "manage_team_smart_views", - "merge_leads" - ] - }] + return [ + { + "date_created": "0001-01-01T00:00:00", + "date_updated": "0001-01-01T00:00:00", + "editable": False, + "id": "superuser", + "name": "Super User", + "organization_id": "orga_ya3w9oMjeLtWe7zFGZr63Dz8ruBbjybG0EIUdUXaESi", + "permissions": [ + "bulk_delete", + "bulk_edit", + "bulk_email", + "bulk_import", + "bulk_sequence_subscriptions", + "call_coach_barge", + "call_coach_listen", + "calling", + "delete_leads", + "delete_own_activities", + "delete_own_opportunities", + "delete_own_tasks", + "export", + "manage_customizations", + "manage_email_sequences", + "manage_group_numbers", + "manage_others_activities", + "manage_others_opportunities", + "manage_others_tasks", + "manage_team_email_templates", + "manage_team_smart_views", + "merge_leads", + ], + } + ] def test_compare_two_records(not_sorted_data, sorted_data): diff --git a/airbyte-integrations/connectors/source-facebook-pages/README.md b/airbyte-integrations/connectors/source-facebook-pages/README.md index bd3e29e0a782..cfee17cce859 100644 --- a/airbyte-integrations/connectors/source-facebook-pages/README.md +++ b/airbyte-integrations/connectors/source-facebook-pages/README.md @@ -95,7 +95,7 @@ Place custom tests inside `integration_tests/` folder, then, from the connector python -m pytest integration_tests ``` #### Acceptance Tests -Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](source-acceptance-tests.md) for more information. +Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/source-acceptance-tests-reference) for more information. If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py. To run your integration tests with acceptance tests, from the connector root, run ``` diff --git a/airbyte-integrations/connectors/source-facebook-pages/acceptance-test-config.yml b/airbyte-integrations/connectors/source-facebook-pages/acceptance-test-config.yml index e58a46028f84..88c7f8e4f8fa 100644 --- a/airbyte-integrations/connectors/source-facebook-pages/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-facebook-pages/acceptance-test-config.yml @@ -1,4 +1,4 @@ -# See [Source Acceptance Tests](https://docs.airbyte.io/contributing-to-airbyte/building-new-connector/source-acceptance-tests.md) +# See [Source Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/source-acceptance-tests-reference) # for more information about how to configure these tests connector_image: airbyte/source-facebook-pages:dev tests: diff --git a/airbyte-integrations/connectors/source-slack/source_slack/source.py b/airbyte-integrations/connectors/source-slack/source_slack/source.py index 439697d86edb..9a66766a3597 100644 --- a/airbyte-integrations/connectors/source-slack/source_slack/source.py +++ b/airbyte-integrations/connectors/source-slack/source_slack/source.py @@ -86,9 +86,9 @@ def backoff_time(self, response: requests.Response) -> Optional[float]: fall back on default retry behavior. Rate Limits Docs: https://api.slack.com/docs/rate-limits#web""" - if "Retry-After" in response.headers: + if "Retry-After" in response.headers: return int(response.headers["Retry-After"]) - else: + else: self.logger.info("Retry-after header not found. Using default backoff value") return 5 diff --git a/docs/deploying-airbyte/on-kubernetes.md b/docs/deploying-airbyte/on-kubernetes.md index 0fb0feac66cd..4b4a0e15b3c3 100644 --- a/docs/deploying-airbyte/on-kubernetes.md +++ b/docs/deploying-airbyte/on-kubernetes.md @@ -238,8 +238,7 @@ kubectl exec -it airbyte-scheduler-6b5747df5c-bj4fx cat /tmp/workspace/8/0/logs. ### Persistent storage on GKE regional cluster Running Airbyte on GKE regional cluster requires enabling persistent regional storage. To do so, enable [CSI driver](https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/gce-pd-csi-driver) -on GKE. After enabling, add `storageClassName: standard-rwo` to the [volume-configs](../../kube/resources/volume-configs.yaml) and [volume-workspace](../../kube/resources/volume-workspace.yaml) -yamls. +on GKE. After enabling, add `storageClassName: standard-rwo` to the [volume-configs](../../kube/resources/volume-configs.yaml) yaml. `volume-configs.yaml` example: ```yaml diff --git a/docs/integrations/sources/facebook-pages.md b/docs/integrations/sources/facebook-pages.md new file mode 100644 index 000000000000..6a24f7ac2d99 --- /dev/null +++ b/docs/integrations/sources/facebook-pages.md @@ -0,0 +1,7 @@ +# Facebook Pages + +## Changelog + +| Version | Date | Pull Request | Subject | +| :------ | :-------- | :----- | :------ | +| 0.1.0 | 2021-09-01 | [5158](https://github.com/airbytehq/airbyte/pull/5158) | Initial release. |