Skip to content

Commit

Permalink
Merge branch 'master' into george/fb-marketing
Browse files Browse the repository at this point in the history
  • Loading branch information
Phlair committed May 3, 2022
2 parents 3cc9060 + c570225 commit 5de126d
Show file tree
Hide file tree
Showing 151 changed files with 2,589 additions and 756 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.36.5-alpha
current_version = 0.36.6-alpha
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-[a-z]+)?
Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


### SHARED ###
VERSION=0.36.5-alpha
VERSION=0.36.6-alpha

# When using the airbyte-db via default docker image
CONFIG_ROOT=/data
Expand Down
260 changes: 260 additions & 0 deletions .github/workflows/build-connector-command.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
name: Bump, Build, Test Connectors [EXPERIMENTAL]
on:
workflow_dispatch:
inputs:
repo:
description: "Repo to check out code from. Defaults to the main airbyte repo. Set this when building connectors from forked repos."
required: false
default: "airbytehq/airbyte"
gitref:
description: "The git ref to check out from the specified repository."
required: false
default: master
connector:
description: "Airbyte Connector"
required: true
bump-version:
description: "Set to major, minor, or patch to automatically bump connectors version in Dockerfile, definitions.yaml and generate seed spec. You can also do this manually"
required: false
default: "false"
run-tests:
description: "Should run tests"
required: false
default: "true"
comment-id:
description: "The comment-id of the slash command. Used to update the comment with the status."
required: false

jobs:
find_valid_pat:
name: "Find a PAT with room for actions"
timeout-minutes: 10
runs-on: ubuntu-latest
outputs:
pat: ${{ steps.variables.outputs.pat }}
steps:
- name: Checkout Airbyte
uses: actions/checkout@v2
- name: Check PAT rate limits
id: variables
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.AIRBYTEIO_PAT }} \
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
${{ secrets.SUPERTOPHER_PAT }} \
${{ secrets.DAVINCHIA_PAT }}
## Gradle Build
# In case of self-hosted EC2 errors, remove this block.
start-bump-build-test-connector-runner:
name: Start Build EC2 Runner
runs-on: ubuntu-latest
needs: find_valid_pat
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Checkout Airbyte
uses: actions/checkout@v2
with:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.gitref }}
- name: Start AWS Runner
id: start-ec2-runner
uses: ./.github/actions/start-aws-runner
with:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
github-token: ${{ needs.find_valid_pat.outputs.pat }}
# 80 gb disk
ec2-image-id: ami-0d648081937c75a73
bump-build-test-connector:
name: Bump, Build, Test Connector
needs: start-bump-build-test-connector-runner
runs-on: ${{ needs.start-bump-build-test-connector-runner.outputs.label }}
environment: more-secrets
steps:
############################
## SET UP ##
############################
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
with:
service_account_key: ${{ secrets.SPEC_CACHE_SERVICE_ACCOUNT_KEY }}
export_default_credentials: true
- name: Search for valid connector name format
id: regex
uses: AsasInnab/regex-action@v1
with:
regex_pattern: "^(connectors|bases)/[a-zA-Z0-9-_]+$"
regex_flags: "i" # required to be set for this plugin
search_string: ${{ github.event.inputs.connector }}
- name: Validate input workflow format
if: steps.regex.outputs.first_match != github.event.inputs.connector
run: echo "The connector provided has an invalid format!" && exit 1
- name: Link comment to workflow run
if: github.event.inputs.comment-id
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.inputs.comment-id }}
body: |
> :clock2: ${{github.event.inputs.connector}} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
- name: Checkout Airbyte
uses: actions/checkout@v2
with:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.gitref }}
token: ${{ secrets.OCTAVIA_PAT }}
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: "17"
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install Pyenv and Tox
run: |
python3 -m pip install --quiet virtualenv==16.7.9 --user
python3 -m virtualenv venv
source venv/bin/activate
pip install --quiet tox==3.24.4
- name: Install yq
if: github.event.inputs.bump-version != 'false' && success()
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
sudo add-apt-repository ppa:rmescandon/yq
sudo apt update
sudo apt install yq -y
- name: Test and install CI scripts
# all CI python packages have the prefix "ci_"
run: |
source venv/bin/activate
tox -r -c ./tools/tox_ci.ini
pip install --quiet -e ./tools/ci_*
- name: Get Credentials for ${{ github.event.inputs.connector }}
run: |
source venv/bin/activate
ci_credentials ${{ github.event.inputs.connector }}
env:
GCP_GSM_CREDENTIALS: ${{ secrets.GCP_GSM_CREDENTIALS }}
# TODO: seems like this should run in post-merge workflow
# - name: Prepare Sentry
# if: startsWith(github.event.inputs.connector, 'connectors')
# run: |
# curl -sL https://sentry.io/get-cli/ | bash
# - name: Create Sentry Release
# if: startsWith(github.event.inputs.connector, 'connectors')
# run: |
# sentry-cli releases set-commits "${{ env.IMAGE_NAME }}@${{ env.IMAGE_VERSION }}" --auto --ignore-missing
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_CONNECTOR_RELEASE_AUTH_TOKEN }}
# SENTRY_ORG: airbyte-5j
# SENTRY_PROJECT: airbyte-connectors
############################
## BUMP ##
############################
- name: Bump Connector Version
if: github.event.inputs.bump-version != 'false' && success()
run: ./tools/integrations/manage.sh bump_version airbyte-integrations/${{ github.event.inputs.connector }}
- name: Commit and Push Version Bump
if: github.event.inputs.bump-version != 'false' && success()
run: |
git config user.name 'Octavia Squidington III'
git config user.email 'octavia-squidington-iii@users.noreply.github.com'
git add -u
git commit -m "bump-version ${{github.event.inputs.connector}}"
git push origin ${{ github.event.inputs.gitref }}
- name: Add Version Bump Success Comment
if: github.event.inputs.comment-id && github.event.inputs.bump-version != 'false' && success()
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.inputs.comment-id }}
body: |
> :rocket: Bumped version for ${{github.event.inputs.connector}}
- name: Add Version Bump Failure Comment
if: github.event.inputs.comment-id && github.event.inputs.bump-version != 'false' && !success()
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.inputs.comment-id }}
body: |
> :x: Couldn't bump version for ${{github.event.inputs.connector}}
############################
## BUILD AND TEST ##
############################
- name: Build ${{ github.event.inputs.connector }}
run: ./tools/integrations/manage.sh build_experiment airbyte-integrations/${{ github.event.inputs.connector }}
id: build
env:
PR_NUMBER: ${{ github.event.number }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# Oracle expects this variable to be set. Although usually present, this is not set by default on Github virtual runners.
TZ: UTC
# - name: Test ${{ github.event.inputs.connector }}
# if: github.event.inputs.run-tests == 'true'
# run: ./tools/integrations/manage.sh test airbyte-integrations/${{ github.event.inputs.connector }}
# - name: Finalize Sentry release
# if: startsWith(github.event.inputs.connector, 'connectors')
# run: |
# sentry-cli releases finalize "${{ env.IMAGE_NAME }}@${{ env.IMAGE_VERSION }}"
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_CONNECTOR_RELEASE_AUTH_TOKEN }}
# SENTRY_ORG: airbyte-5j
# SENTRY_PROJECT: airbyte-connectors
# - name: Build and Test Success Comment
# if: github.event.inputs.comment-id && success()
# uses: peter-evans/create-or-update-comment@v1
# with:
# comment-id: ${{ github.event.inputs.comment-id }}
# body: |
# > :rocket: Successfully built and tested ${{github.event.inputs.connector}}
# - name: Build and Test Failure Comment
# if: github.event.inputs.comment-id && !success()
# uses: peter-evans/create-or-update-comment@v1
# with:
# comment-id: ${{ github.event.inputs.comment-id }}
# body: |
# > :x: Failed to build and test ${{github.event.inputs.connector}}
# - name: Slack Notification - Failure
# if: failure()
# uses: rtCamp/action-slack-notify@master
# env:
# SLACK_WEBHOOK: ${{ secrets.BUILD_SLACK_WEBHOOK }}
# SLACK_USERNAME: Buildozer
# SLACK_ICON: https://avatars.slack-edge.com/temp/2020-09-01/1342729352468_209b10acd6ff13a649a1.jpg
# SLACK_COLOR: DC143C
# SLACK_TITLE: "Failed to build and test connector ${{ github.event.inputs.connector }} from branch ${{ github.ref }}"
# SLACK_FOOTER: ""
# - name: Add Final Success Comment
# if: github.event.inputs.comment-id && success()
# uses: peter-evans/create-or-update-comment@v1
# with:
# comment-id: ${{ github.event.inputs.comment-id }}
# body: |
# > :white_check_mark: ${{github.event.inputs.connector}} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
# - name: Set publish label
# if: success()
# run: |
# echo "set some label on PR"
# In case of self-hosted EC2 errors, remove this block.
stop-bump-build-test-connector-runner:
name: Stop Build EC2 Runner
needs:
- start-bump-build-test-connector-runner # required to get output from the start-runner job
- bump-build-test-connector # required to wait when the main job is done
- find_valid_pat
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Stop EC2 runner
uses: supertopher/ec2-github-runner@base64v1.0.10
with:
mode: stop
github-token: ${{ needs.find_valid_pat.outputs.pat }}
label: ${{ needs.start-bump-build-test-connector-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-bump-build-test-connector-runner.outputs.ec2-instance-id }}
Loading

1 comment on commit 5de126d

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SonarQube Report

SonarQube report for Airbyte Connectors Source Facebook Marketing(#12390)

Measures

Name Value Name Value Name Value
Vulnerabilities 0 Quality Gate Status ERROR Lines to Cover 7
Duplicated Blocks 0 Code Smells 1 Bugs 0
Reliability Rating A Security Rating A Duplicated Lines (%) 0.0
Lines of Code 1192 Coverage 100.0 Blocker Issues 0
Critical Issues 1 Major Issues 1 Minor Issues 94

Detected Issues

Rule File Description Message
python:S3776 (CRITICAL) streams/async_job_manager.py:84 Cognitive Complexity of functions should not be too high Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
python:mypy_import (MINOR) source_facebook_marketing/source.py:9 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: import requests
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:86 Check that attribute exists "Mapping[str, Any]" has no attribute "custom_insights" . Code line: ... return self._update_insights_streams(insights=config.custom_insight...
python:mypy_arg_type (MINOR) source_facebook_marketing/source.py:120 Check argument types in calls Argument 1 to "set" has incompatible type "Optional[List[ValidFields]]"; expected "Iterable[ValidFields]" . Code line: fields=list(set(insight.fields)),
python:mypy_arg_type (MINOR) source_facebook_marketing/source.py:120 Check argument types in calls Argument 1 to "set" has incompatible type "Optional[List[ValidFields]]"; expected "Iterable[Any]" . Code line: fields=list(set(insight.fields)),
python:mypy_arg_type (MINOR) source_facebook_marketing/source.py:121 Check argument types in calls Argument 1 to "set" has incompatible type "Optional[List[ValidBreakdowns]]"; expected "Iterable[ValidBreakdowns]" . Code line: breakdowns=list(set(insight.breakdowns)),
python:mypy_arg_type (MINOR) source_facebook_marketing/source.py:121 Check argument types in calls Argument 1 to "set" has incompatible type "Optional[List[ValidBreakdowns]]"; expected "Iterable[Any]" . Code line: breakdowns=list(set(insight.breakdowns)),
python:mypy_arg_type (MINOR) source_facebook_marketing/source.py:122 Check argument types in calls Argument 1 to "set" has incompatible type "Optional[List[ValidActionBreakdowns]]"; expected "Iterable[ValidActionBreakdowns]" . Code line: action_breakdowns=list(set(insight.action_breakdowns))...
python:mypy_arg_type (MINOR) source_facebook_marketing/source.py:122 Check argument types in calls Argument 1 to "set" has incompatible type "Optional[List[ValidActionBreakdowns]]"; expected "Iterable[Any]" . Code line: action_breakdowns=list(set(insight.action_breakdowns))...
python:mypy_attr_defined (MINOR) streams/base_streams.py:246 Check that attribute exists Module has no attribute "parse" . Code line: record_cursor_value = pendulum.parse(record[self.cursor_fi...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:83 Check that attribute exists "Mapping[str, Any]" has no attribute "start_date" . Code line: Activities(api=api, start_date=config.start_date, end_date...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:83 Check that attribute exists "Mapping[str, Any]" has no attribute "end_date" . Code line: ...(api=api, start_date=config.start_date, end_date=config.end_date, incl...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:83 Check that attribute exists "Mapping[str, Any]" has no attribute "include_deleted" . Code line: ..._date, end_date=config.end_date, include_deleted=config.include_delete...
python:mypy_assignment (MINOR) streams/streams.py:101 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "FBMarketingStream" defined the type as "None") . Code line: entity_prefix = "activity"
python:mypy_assignment (MINOR) streams/streams.py:103 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", base class "FBMarketingStream" defined the type as "str") . Code line: primary_key = None
python:mypy_override (MINOR) streams/streams.py:105 Check that method override is compatible with base class Signature of "list_objects" incompatible with supertype "FBMarketingStream" . Code line: def list_objects(self, fields: List[str], params: Mapping[str, Any...
python:mypy_no_any_return (MINOR) streams/streams.py:106 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[Any]" . Code line: return self._api.account.get_activities(fields=fields, params=...
python:mypy_arg_type (MINOR) streams/streams.py:116 Check argument types in calls Argument "stream_state" to "request_params" of "FBMarketingIncrementalStream" has incompatible type "Optional[Mapping[str, Any]]"; expected "Mapping[str, Any]" . Code line: ...ds=self.fields, params=self.request_params(stream_state=stream_state))
python:mypy_attr_defined (MINOR) streams/streams.py:127 Check that attribute exists Module has no attribute "parse" . Code line: ...since = self.start_date if not state_value else pendulum.parse(state...
python:mypy_no_redef (MINOR) streams/base_streams.py:76 Check that each name is defined once Name "api_batch" already defined on line 69 . Code line: api_batch: FacebookAdsApiBatch = self._api.api.new_bat...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:45 Check that attribute exists "Mapping[str, Any]" has no attribute "end_date" . Code line: if pendulum.instance(config.end_date) < pendulum.instance(conf...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:45 Check that attribute exists "Mapping[str, Any]" has no attribute "start_date" . Code line: ...ulum.instance(config.end_date) < pendulum.instance(config.start_date):
python:mypy_no_redef (MINOR) source_facebook_marketing/source.py:60 Check that each name is defined once Name "config" already defined on line 54 . Code line: config: ConnectorConfig = ConnectorConfig.parse_obj(config)
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:80 Check that attribute exists "Mapping[str, Any]" has no attribute "start_date" . Code line: Campaigns(api=api, start_date=config.start_date, end_date=...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:80 Check that attribute exists "Mapping[str, Any]" has no attribute "end_date" . Code line: ...(api=api, start_date=config.start_date, end_date=config.end_date, incl...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:80 Check that attribute exists "Mapping[str, Any]" has no attribute "include_deleted" . Code line: ..._date, end_date=config.end_date, include_deleted=config.include_delete...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:82 Check that attribute exists "Mapping[str, Any]" has no attribute "start_date" . Code line: Videos(api=api, start_date=config.start_date, end_date=con...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:82 Check that attribute exists "Mapping[str, Any]" has no attribute "end_date" . Code line: ...(api=api, start_date=config.start_date, end_date=config.end_date, incl...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:82 Check that attribute exists "Mapping[str, Any]" has no attribute "include_deleted" . Code line: ..._date, end_date=config.end_date, include_deleted=config.include_delete...
python:mypy_misc (MINOR) source_facebook_marketing/spec.py:18 Miscellaneous other checks Enum() expects a string, tuple, list or dict literal as the second argument . Code line: ValidFields = Enum("ValidEnums", AdsInsights.Field.dict)
python:mypy_misc (MINOR) source_facebook_marketing/spec.py:19 Miscellaneous other checks Enum() expects a string, tuple, list or dict literal as the second argument . Code line: ValidBreakdowns = Enum("ValidBreakdowns", AdsInsights.Breakdowns.__dic...
python:mypy_name_defined (MINOR) source_facebook_marketing/spec.py:20 Check that name is defined Enum() expects a string, tuple, list or dict literal as the second argument [misc] ValidActionBreakdowns = Enum("ValidActionBreakdowns", AdsInsights.Acti...
python:mypy_attr_defined (MINOR) streams/init.py:5 Check that attribute exists Module "source_facebook_marketing.streams.streams" does not explicitly export attribute "AdsInsights"; implicit reexport disabled . Code line: from .streams import (
python:mypy_arg_type (MINOR) streams/async_job.py:149 Check argument types in calls Argument "jobs" to "update_in_batch" has incompatible type "List[InsightAsyncJob]"; expected "List[AsyncJob]" . Code line: update_in_batch(api=self._api, jobs=self._jobs)
python:mypy_return_value (MINOR) streams/async_job.py:242 Check that return value is compatible with signature Incompatible return value type (got "List[InsightAsyncJob]", expected "List[AsyncJob]") . Code line: return jobs
python:mypy_unreachable (MINOR) streams/async_job.py:272 Warn about unreachable statements or expressions Statement is unreachable . Code line: end_time = self._finish_time or pendulum.now()
python:mypy_index (MINOR) streams/async_job.py:321 Check indexing operations Value of type "Optional[Any]" is not indexable . Code line: job_status = self._job["async_status"]
python:mypy_index (MINOR) streams/async_job.py:322 Check indexing operations Value of type "Optional[Any]" is not indexable . Code line: percent = self._job["async_percent_completion"]
python:mypy_operator (MINOR) streams/async_job.py:325 Check that operator is valid for operands Unsupported operand types for < ("Duration" and "None") . Code line: if self.elapsed_time > self.job_timeout:
python:mypy_assignment (MINOR) streams/async_job.py:327 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "DateTime", variable has type "None") . Code line: self._finish_time = pendulum.now()
python:mypy_assignment (MINOR) streams/async_job.py:331 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "DateTime", variable has type "None") . Code line: self._finish_time = pendulum.now() # TODO: is not actual ...
python:mypy_assignment (MINOR) streams/async_job.py:334 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "DateTime", variable has type "None") . Code line: self._finish_time = pendulum.now()
python:mypy_attr_defined (MINOR) streams/async_job.py:336 Check that attribute exists "None" has no attribute "in_seconds" . Code line: ...er.info(f"{self}: has status {job_status} after {self.elapsed_time.in_...
python:mypy_var_annotated (MINOR) streams/async_job_manager.py:43 Require variable annotation if type can't be inferred Need type annotation for "_running_jobs" (hint: "_running_jobs: List[] = ...") . Code line: self._running_jobs = []
python:mypy_no_any_return (MINOR) streams/async_job_manager.py:142 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "float" . Code line: return min(throttle.per_account, throttle.per_application)
python:mypy_name_defined (MINOR) streams/base_insight_streams.py:58 Check that name is defined Need type annotation for "breakdowns" (hint: "breakdowns: List[] = ...") [var-annotated] breakdowns = []
python:mypy_var_annotated (MINOR) streams/base_insight_streams.py:81 Require variable annotation if type can't be inferred Need type annotation for "_completed_slices" (hint: "_completed_slices: Set[] = ...") . Code line: self._completed_slices = set()
python:mypy_no_any_return (MINOR) streams/base_insight_streams.py:87 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return casing.camel_to_snake(name)
python:mypy_override (MINOR) streams/base_insight_streams.py:90 Check that method override is compatible with base class Signature of "primary_key" incompatible with supertype "FBMarketingStream" . Code line: def primary_key(self) -> Optional[Union[str, List[str], List[List[...
python:mypy_index (MINOR) streams/base_insight_streams.py:105 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: job = stream_slice["insight_job"]
python:mypy_attr_defined (MINOR) streams/base_insight_streams.py:141 Check that attribute exists Module has no attribute "parse" . Code line: self._cursor_value = pendulum.parse(value[self.cursor_field])....
python:mypy_attr_defined (MINOR) streams/base_insight_streams.py:142 Check that attribute exists Module has no attribute "parse" . Code line: self._completed_slices = set(pendulum.parse(v).date() for v in...
python:mypy_attr_defined (MINOR) streams/base_insight_streams.py:180 Check that attribute exists Module has no attribute "Period"; maybe "period"? . Code line: interval = pendulum.Period(ts_start, ts_end)
python:mypy_name_defined (MINOR) streams/base_insight_streams.py:200 Check that name is defined Incompatible types in assignment (expression has type "Mapping[str, Any]", variable has type "MutableMapping[str, Any]") [assignment] self.state = stream_state
python:mypy_override (MINOR) streams/base_insight_streams.py:240 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "FBMarketingIncrementalStream" . Code line: def request_params(self, **kwargs) -> MutableMapping[str, Any]:
python:mypy_no_any_return (MINOR) streams/base_insight_streams.py:265 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Mapping[str, Any]" . Code line: return schema
python:mypy_assignment (MINOR) streams/base_streams.py:92 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Iterable[MutableMapping[str, Any]]", variable has type "Generator[Any, None, None]") . Code line: loaded_records_iter = self.execute_in_batch(loaded_records...
python:mypy_attr_defined (MINOR) streams/base_streams.py:161 Check that attribute exists Module has no attribute "parse" . Code line: max_cursor = max(pendulum.parse(state_value), pendulum.parse(r...
python:mypy_override (MINOR) streams/base_streams.py:170 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "FBMarketingStream" . Code line: def request_params(self, stream_state: Mapping[str, Any], **kwargs...
python:mypy_attr_defined (MINOR) streams/base_streams.py:179 Check that attribute exists Module has no attribute "parse" . Code line: ...value = self.start_date if not state_value else pendulum.parse(state...
python:mypy_attr_defined (MINOR) streams/base_streams.py:225 Check that attribute exists Module has no attribute "parse" . Code line: self._cursor_value = pendulum.parse(value[self.cursor_field])
python:mypy_arg_type (MINOR) streams/base_streams.py:244 Check argument types in calls Argument "stream_state" to "request_params" of "FBMarketingIncrementalStream" has incompatible type "Optional[Mapping[str, Any]]"; expected "Mapping[str, Any]" . Code line: ...lf.list_objects(params=self.request_params(stream_state=stream_state))
python:mypy_import (MINOR) streams/streams.py:10 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: import requests
python:mypy_assignment (MINOR) streams/streams.py:42 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "FBMarketingStream" defined the type as "None") . Code line: entity_prefix = "adcreative"
python:mypy_index (MINOR) streams/streams.py:64 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: record["thumbnail_data_url"] = fetch_thumbnail_data_ur...
python:mypy_arg_type (MINOR) streams/streams.py:64 Check argument types in calls Argument 1 to "fetch_thumbnail_data_url" has incompatible type "Optional[Any]"; expected "str" . Code line: ..."thumbnail_data_url"] = fetch_thumbnail_data_url(record.get("thumbnail...
python:mypy_no_any_return (MINOR) streams/streams.py:68 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[Any]" . Code line: return self._api.account.get_ad_creatives(params=params)
python:mypy_assignment (MINOR) streams/streams.py:74 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "FBMarketingStream" defined the type as "None") . Code line: entity_prefix = "ad"
python:mypy_no_any_return (MINOR) streams/streams.py:77 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[Any]" . Code line: return self._api.account.get_ads(params=params)
python:mypy_assignment (MINOR) streams/streams.py:83 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "FBMarketingStream" defined the type as "None") . Code line: entity_prefix = "adset"
python:mypy_no_any_return (MINOR) streams/streams.py:86 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[Any]" . Code line: return self._api.account.get_ad_sets(params=params)
python:mypy_assignment (MINOR) streams/streams.py:92 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "FBMarketingStream" defined the type as "None") . Code line: entity_prefix = "campaign"
python:mypy_no_any_return (MINOR) streams/streams.py:95 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[Any]" . Code line: return self._api.account.get_campaigns(params=params)
python:mypy_assignment (MINOR) streams/streams.py:140 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "FBMarketingStream" defined the type as "None") . Code line: entity_prefix = "video"
python:mypy_no_any_return (MINOR) streams/streams.py:143 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[Any]" . Code line: return self._api.account.get_ad_videos(params=params)
python:mypy_no_any_return (MINOR) streams/streams.py:161 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[Any]" . Code line: return self._api.account.get_ad_images(params=params, fields=s...
python:mypy_var_annotated (MINOR) streams/streams.py:188 Require variable annotation if type can't be inferred Need type annotation for "breakdowns" (hint: "breakdowns: List[] = ...") . Code line: breakdowns = []
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:81 Check that attribute exists "Mapping[str, Any]" has no attribute "start_date" . Code line: Images(api=api, start_date=config.start_date, end_date=con...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:81 Check that attribute exists "Mapping[str, Any]" has no attribute "end_date" . Code line: ...(api=api, start_date=config.start_date, end_date=config.end_date, incl...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:81 Check that attribute exists "Mapping[str, Any]" has no attribute "include_deleted" . Code line: ..._date, end_date=config.end_date, include_deleted=config.include_delete...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:72 Check that attribute exists "Mapping[str, Any]" has no attribute "fetch_thumbnail_images" . Code line: ... AdCreatives(api=api, fetch_thumbnail_images=config.fetch_thumbnai...
python:mypy_no_any_return (MINOR) source_facebook_marketing/source.py:112 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "List[Type[Any]]" . Code line: return streams
python:mypy_no_any_return (MINOR) source_facebook_marketing/source.py:130 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "List[Type[Any]]" . Code line: return streams + insights_custom_streams
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:66 Check that attribute exists "Mapping[str, Any]" has no attribute "end_date" . Code line: end_date=config.end_date,
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:70 Check that attribute exists "Mapping[str, Any]" has no attribute "start_date" . Code line: AdSets(api=api, start_date=config.start_date, end_date=con...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:70 Check that attribute exists "Mapping[str, Any]" has no attribute "end_date" . Code line: ...(api=api, start_date=config.start_date, end_date=config.end_date, incl...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:70 Check that attribute exists "Mapping[str, Any]" has no attribute "include_deleted" . Code line: ..._date, end_date=config.end_date, include_deleted=config.include_delete...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:71 Check that attribute exists "Mapping[str, Any]" has no attribute "start_date" . Code line: Ads(api=api, start_date=config.start_date, end_date=config...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:71 Check that attribute exists "Mapping[str, Any]" has no attribute "end_date" . Code line: ...(api=api, start_date=config.start_date, end_date=config.end_date, incl...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:71 Check that attribute exists "Mapping[str, Any]" has no attribute "include_deleted" . Code line: ..._date, end_date=config.end_date, include_deleted=config.include_delete...
python:S1700 (MAJOR) source_facebook_marketing/api.py:164 A field should not duplicate the name of its containing class Rename field "api"
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:48 Check that attribute exists "Mapping[str, Any]" has no attribute "account_id" . Code line: api = API(account_id=config.account_id, access_token=confi...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:48 Check that attribute exists "Mapping[str, Any]" has no attribute "access_token" . Code line: ... = API(account_id=config.account_id, access_token=config.access_token)
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:61 Check that attribute exists "Mapping[str, Any]" has no attribute "account_id" . Code line: api = API(account_id=config.account_id, access_token=config.ac...
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:61 Check that attribute exists "Mapping[str, Any]" has no attribute "access_token" . Code line: ... = API(account_id=config.account_id, access_token=config.access_token)
python:mypy_attr_defined (MINOR) source_facebook_marketing/source.py:65 Check that attribute exists "Mapping[str, Any]" has no attribute "start_date" . Code line: start_date=config.start_date,

Coverage (100.0%)

File Coverage File Coverage
source_facebook_marketing/init.py 100.0 source_facebook_marketing/api.py 90.6
source_facebook_marketing/source.py 97.4 source_facebook_marketing/spec.py 100.0
source_facebook_marketing/streams/init.py 100.0 source_facebook_marketing/streams/async_job.py 100.0
source_facebook_marketing/streams/async_job_manager.py 96.2 source_facebook_marketing/streams/base_insight_streams.py 89.9
source_facebook_marketing/streams/base_streams.py 76.4 source_facebook_marketing/streams/common.py 97.6
source_facebook_marketing/streams/streams.py 77.3

Please sign in to comment.