Skip to content

Commit

Permalink
Merge branch 'master' into grubberr/issue-12540-source-amazon-ads
Browse files Browse the repository at this point in the history
  • Loading branch information
grubberr committed May 3, 2022
2 parents 6812dd0 + 7e79cac commit d2306d5
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 73 deletions.
2 changes: 1 addition & 1 deletion airbyte-webapp/src/core/analytics/AnalyticsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class AnalyticsService {

reset = (): void => this.getSegmentAnalytics()?.reset?.();

track = (name: string, properties: Record<string, unknown>): void =>
track = <P = Record<string, unknown>>(name: string, properties: P): void =>
this.getSegmentAnalytics()?.track?.(name, {
...properties,
...this.context,
Expand Down
16 changes: 1 addition & 15 deletions airbyte-webapp/src/hooks/services/useDestinationHook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ const useCreateDestination = () => {
const queryClient = useQueryClient();
const workspace = useCurrentWorkspace();

const analyticsService = useAnalyticsService();

return useMutation(
async (createDestinationPayload: { values: ValuesProps; destinationConnector?: ConnectorProps }) => {
const { values, destinationConnector } = createDestinationPayload;
Expand All @@ -78,23 +76,11 @@ const useCreateDestination = () => {
});
},
{
onSuccess: (data, ctx) => {
analyticsService.track("New Destination - Action", {
action: "Tested connector - success",
connector_destination: ctx.destinationConnector?.name,
connector_destination_definition_id: ctx.destinationConnector?.destinationDefinitionId,
});
onSuccess: (data) => {
queryClient.setQueryData(destinationsKeys.lists(), (lst: DestinationList | undefined) => ({
destinations: [data, ...(lst?.destinations ?? [])],
}));
},
onError: (_, ctx) => {
analyticsService.track("New Destination - Action", {
action: "Tested connector - failure",
connector_destination: ctx.destinationConnector?.name,
connector_destination_definition_id: ctx.destinationConnector?.destinationDefinitionId,
});
},
}
);
};
Expand Down
19 changes: 0 additions & 19 deletions airbyte-webapp/src/hooks/services/useSourceHook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,9 @@ const useCreateSource = () => {
const queryClient = useQueryClient();
const workspace = useCurrentWorkspace();

const analyticsService = useAnalyticsService();

return useMutation(
async (createSourcePayload: { values: ValuesProps; sourceConnector?: ConnectorProps }) => {
const { values, sourceConnector } = createSourcePayload;
analyticsService.track("New Source - Action", {
action: "Test a connector",
connector_source: sourceConnector?.name,
connector_source_id: sourceConnector?.sourceDefinitionId,
});

try {
// Try to crete source
const result = await service.create({
Expand All @@ -88,19 +80,8 @@ const useCreateSource = () => {
connectionConfiguration: values.connectionConfiguration,
});

analyticsService.track("New Source - Action", {
action: "Tested connector - success",
connector_source: sourceConnector?.name,
connector_source_id: sourceConnector?.sourceDefinitionId,
});

return result;
} catch (e) {
analyticsService.track("New Source - Action", {
action: "Tested connector - failure",
connector_source: sourceConnector?.name,
connector_source_id: sourceConnector?.sourceDefinitionId,
});
throw e;
}
},
Expand Down
26 changes: 26 additions & 0 deletions airbyte-webapp/src/hooks/useTrackAction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { useCallback } from "react";

import { useAnalyticsService } from "./services/Analytics/useAnalyticsService";

export const enum TrackActionType {
NEW_SOURCE = "New Source",
NEW_DESTINATION = "New Destination",
}

interface TrackActionProperties {
connector_source?: string;
connector_source_definition_id?: string;
connector_destination?: string;
connector_destination_definition_id?: string;
}

export const useTrackAction = (type: TrackActionType) => {
const analyticsService = useAnalyticsService();

return useCallback(
(action: string, properties: TrackActionProperties) => {
analyticsService.track(`${type} - Action`, { action, ...properties });
},
[analyticsService, type]
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { FormattedMessage } from "react-intl";
import { ConnectionConfiguration } from "core/domain/connection";
import { DestinationDefinition } from "core/domain/connector";
import { LogsRequestError } from "core/request/LogsRequestError";
import { useAnalyticsService } from "hooks/services/Analytics/useAnalyticsService";
import useRouter from "hooks/useRouter";
import { TrackActionType, useTrackAction } from "hooks/useTrackAction";
import { useGetDestinationDefinitionSpecificationAsync } from "services/connector/DestinationDefinitionSpecificationService";
import { createFormErrorMessage } from "utils/errorStatusMessage";
import { ConnectorCard } from "views/Connector/ConnectorCard";
Expand Down Expand Up @@ -39,7 +39,7 @@ const DestinationForm: React.FC<IProps> = ({
afterSelectConnector,
}) => {
const { location } = useRouter();
const analyticsService = useAnalyticsService();
const trackNewDestinationAction = useTrackAction(TrackActionType.NEW_DESTINATION);

const [destinationDefinitionId, setDestinationDefinitionId] = useState(
hasDestinationDefinitionId(location.state) ? location.state.destinationDefinitionId : null
Expand All @@ -58,9 +58,8 @@ const DestinationForm: React.FC<IProps> = ({
afterSelectConnector();
}

analyticsService.track("New Destination - Action", {
action: "Select a connector",
connector_destination_definition: connector?.name,
trackNewDestinationAction("Select a connector", {
connector_destination: connector?.name,
connector_destination_definition_id: destinationDefinitionId,
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { FormattedMessage } from "react-intl";

import { ConnectionConfiguration } from "core/domain/connection";
import { JobInfo } from "core/domain/job";
import { useAnalyticsService } from "hooks/services/Analytics/useAnalyticsService";
import { useCreateDestination } from "hooks/services/useDestinationHook";
import { TrackActionType, useTrackAction } from "hooks/useTrackAction";
import { useDestinationDefinitionList } from "services/connector/DestinationDefinitionService";
import { useGetDestinationDefinitionSpecificationAsync } from "services/connector/DestinationDefinitionSpecificationService";
import { createFormErrorMessage } from "utils/errorStatusMessage";
Expand All @@ -31,7 +31,7 @@ const DestinationStep: React.FC<Props> = ({ onNextStep, onSuccess }) => {
} | null>(null);

const { mutateAsync: createDestination } = useCreateDestination();
const analyticsService = useAnalyticsService();
const trackNewDestinationAction = useTrackAction(TrackActionType.NEW_DESTINATION);

const getDestinationDefinitionById = (id: string) =>
destinationDefinitions.find((item) => item.destinationDefinitionId === id);
Expand Down Expand Up @@ -64,8 +64,7 @@ const DestinationStep: React.FC<Props> = ({ onNextStep, onSuccess }) => {

const onDropDownSelect = (destinationDefinitionId: string) => {
const destinationConnector = getDestinationDefinitionById(destinationDefinitionId);
analyticsService.track("New Destination - Action", {
action: "Select a connector",
trackNewDestinationAction("Select a connector", {
connector_destination: destinationConnector?.name,
connector_destination_definition_id: destinationConnector?.destinationDefinitionId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { FormattedMessage } from "react-intl";
import { ConnectionConfiguration } from "core/domain/connection";
import { JobInfo } from "core/domain/job";
import { LogsRequestError } from "core/request/LogsRequestError";
import { useAnalyticsService } from "hooks/services/Analytics/useAnalyticsService";
import { useCreateSource } from "hooks/services/useSourceHook";
import { TrackActionType, useTrackAction } from "hooks/useTrackAction";
import { useSourceDefinitionList } from "services/connector/SourceDefinitionService";
import { useGetSourceDefinitionSpecificationAsync } from "services/connector/SourceDefinitionSpecificationService";
import { createFormErrorMessage } from "utils/errorStatusMessage";
Expand All @@ -31,7 +31,7 @@ const SourceStep: React.FC<IProps> = ({ onNextStep, onSuccess }) => {

const { mutateAsync: createSource } = useCreateSource();

const analyticsService = useAnalyticsService();
const trackNewSourceAction = useTrackAction(TrackActionType.NEW_SOURCE);

const getSourceDefinitionById = (id: string) => sourceDefinitions.find((item) => item.sourceDefinitionId === id);

Expand Down Expand Up @@ -64,10 +64,9 @@ const SourceStep: React.FC<IProps> = ({ onNextStep, onSuccess }) => {
const onServiceSelect = (sourceId: string) => {
const sourceDefinition = getSourceDefinitionById(sourceId);

analyticsService.track("New Source - Action", {
action: "Select a connector",
trackNewSourceAction("Select a connector", {
connector_source: sourceDefinition?.name,
connector_source_id: sourceDefinition?.sourceDefinitionId,
connector_source_definition_id: sourceDefinition?.sourceDefinitionId,
});

setError(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { FormattedMessage } from "react-intl";
import { ConnectionConfiguration } from "core/domain/connection";
import { SourceDefinition } from "core/domain/connector";
import { LogsRequestError } from "core/request/LogsRequestError";
import { useAnalyticsService } from "hooks/services/Analytics/useAnalyticsService";
import useRouter from "hooks/useRouter";
import { TrackActionType, useTrackAction } from "hooks/useTrackAction";
import { useGetSourceDefinitionSpecificationAsync } from "services/connector/SourceDefinitionSpecificationService";
import { createFormErrorMessage } from "utils/errorStatusMessage";
import { ConnectorCard } from "views/Connector/ConnectorCard";
Expand Down Expand Up @@ -34,7 +34,7 @@ const hasSourceDefinitionId = (state: unknown): state is { sourceDefinitionId: s

const SourceForm: React.FC<IProps> = ({ onSubmit, sourceDefinitions, error, hasSuccess, afterSelectConnector }) => {
const { location } = useRouter();
const analyticsService = useAnalyticsService();
const trackNewSourceAction = useTrackAction(TrackActionType.NEW_SOURCE);

const [sourceDefinitionId, setSourceDefinitionId] = useState<string | null>(
hasSourceDefinitionId(location.state) ? location.state.sourceDefinitionId : null
Expand All @@ -54,9 +54,8 @@ const SourceForm: React.FC<IProps> = ({ onSubmit, sourceDefinitions, error, hasS
afterSelectConnector();
}

analyticsService.track("New Source - Action", {
action: "Select a connector",
connector_source_definition: connector?.name,
trackNewSourceAction("Select a connector", {
connector_source: connector?.name,
connector_source_definition_id: sourceDefinitionId,
});
};
Expand Down
51 changes: 32 additions & 19 deletions airbyte-webapp/src/views/Connector/ConnectorCard/ConnectorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import JobItem from "components/JobItem";
import { Connector, ConnectorT, Scheduler } from "core/domain/connector";
import { JobInfo } from "core/domain/job/Job";
import { LogsRequestError } from "core/request/LogsRequestError";
import { useAnalytics } from "hooks/services/Analytics";
import { TrackActionType, useTrackAction } from "hooks/useTrackAction";
import { createFormErrorMessage } from "utils/errorStatusMessage";
import { ServiceForm, ServiceFormProps, ServiceFormValues } from "views/Connector/ServiceForm";

Expand Down Expand Up @@ -39,33 +39,46 @@ const ConnectorCard: React.FC<

const { testConnector, isTestConnectionInProgress, onStopTesting, error } = useTestConnector(props);

const analyticsService = useAnalytics().service;
const trackNewSourceAction = useTrackAction(TrackActionType.NEW_SOURCE);
const trackNewDestinationAction = useTrackAction(TrackActionType.NEW_DESTINATION);

const onHandleSubmit = async (values: ServiceFormValues) => {
setErrorStatusRequest(null);

const connector = props.availableServices.find((item) => Connector.id(item) === values.serviceType);

try {
if (connector) {
if (props.formType === "source") {
analyticsService.track("New Source - Action", {
action: "Test a connector",
connector_source: connector?.name,
connector_source_definition_id: Connector.id(connector),
});
} else {
analyticsService.track("New Destination - Action", {
action: "Test a connector",
connector_destination: connector?.name,
connector_destination_definition_id: Connector.id(connector),
});
}
const trackAction = (action: string) => {
if (!connector) {
return;
}

await testConnector(values);
await onSubmit(values);
if (props.formType === "source") {
trackNewSourceAction(action, {
connector_source: connector?.name,
connector_source_definition_id: Connector.id(connector),
});
} else {
trackNewDestinationAction(action, {
connector_destination: connector?.name,
connector_destination_definition_id: Connector.id(connector),
});
}
};

const testConnectorWithTracking = async () => {
trackAction("Test a connector");
try {
await testConnector(values);
trackAction("Tested connector - success");
} catch (e) {
trackAction("Tested connector - failure");
throw e;
}
};

try {
await testConnectorWithTracking();
await onSubmit(values);
setSaved(true);
} catch (e) {
setErrorStatusRequest(e);
Expand Down

1 comment on commit d2306d5

@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 Amazon Ads(#12541)

Measures

Name Value Name Value Name Value
Bugs 0 Duplicated Blocks 0 Quality Gate Status OK
Vulnerabilities 0 Coverage 98.8 Code Smells 65
Reliability Rating A Lines to Cover 663 Security Rating A
Duplicated Lines (%) 0.0 Lines of Code 1514 Blocker Issues 0
Critical Issues 0 Major Issues 13 Minor Issues 52

Detected Issues

Rule File Description Message
python:S112 (MAJOR) streams/common.py:153 "Exception" and "BaseException" should not be raised Replace this generic exception class with a more specific one.
python:mypy_assignment (MINOR) report_streams/products_report.py:251 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "List[str]", base class "ReportStream" defined the type as "None") . Code line: primary_key = ["profileId", "recordType", "reportDate"]
python:mypy_attr_defined (MINOR) report_streams/report_streams.py:22 Check that attribute exists Module "pendulum" does not explicitly export attribute "DateTime"; implicit reexport disabled . Code line: from pendulum import DateTime
python:mypy_assignment (MINOR) report_streams/report_streams.py:380 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "DateTime", variable has type "str") . Code line: report_date = pendulum.from_format(report_date, ReportStream.R...
python:mypy_no_any_return (MINOR) report_streams/report_streams.py:383 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return profile_time.format(ReportStream.REPORT_DATE_FORMAT)
python:mypy_arg_type (MINOR) report_streams/report_streams.py:169 Check argument types in calls Argument 1 to "backoff_max_tries" has incompatible type "Callable[[ReportStream, Any], Any]"; expected "ReportStream" . Code line: @backoff_max_tries
python:mypy_arg_type (MINOR) report_streams/report_streams.py:176 Check argument types in calls Argument 1 to "backoff_max_time" has incompatible type "Callable[[ReportStream, Any], Any]"; expected "ReportStream" . Code line: @backoff_max_time
python:mypy_arg_type (MINOR) source_amazon_ads/source.py:72 Check argument types in calls Argument 1 to "_choose_profiles" of "SourceAmazonAds" has incompatible type "Mapping[str, Any]"; expected "AmazonAdsConfig" . Code line: ... stream_args["profiles"] = self._choose_profiles(config, profiles_list...
python:S1066 (MAJOR) schemas/common.py:32 Collapsible "if" statements should be merged Merge this if statement with the enclosing one.
python:mypy_call_overload (MINOR) schemas/common.py:45 Check that an overload variant matches arguments No overload variant of "create_model" matches argument types "str", "Dict[str, Tuple[Type[str], None]]", "Type[CatalogModel]" . Code line: metrics_obj_model = create_model("MetricObjModel", **{f: (str,...
python:mypy_return_value (MINOR) schemas/common.py:46 Check that return value is compatible with signature Incompatible return value type (got "Type[MetricsReport]", expected "CatalogModel") . Code line: return create_model("MetricsModel", metric=(metrics_obj_model,...
python:S5890 (MAJOR) schemas/profile.py:14 Values assigned to variables should match their type annotations Assign to "name" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/profile.py:14 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: name: str = None
python:S5890 (MAJOR) schemas/profile.py:15 Values assigned to variables should match their type annotations Assign to "subType" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/profile.py:15 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: subType: str = None
python:S5890 (MAJOR) schemas/profile.py:16 Values assigned to variables should match their type annotations Assign to "validPaymentMethod" a value of type "bool" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/profile.py:16 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "bool") . Code line: validPaymentMethod: bool = None
python:S5890 (MAJOR) schemas/profile.py:21 Values assigned to variables should match their type annotations Assign to "countryCode" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/profile.py:21 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: countryCode: str = None
python:S5890 (MAJOR) schemas/profile.py:22 Values assigned to variables should match their type annotations Assign to "currencyCode" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/profile.py:22 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: currencyCode: str = None
python:mypy_assignment (MINOR) schemas/profile.py:23 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "Decimal") . Code line: dailyBudget: Decimal = None
python:S5890 (MAJOR) schemas/profile.py:23 Values assigned to variables should match their type annotations Assign to "dailyBudget" a value of type "Decimal" instead of "NoneType" or update its type hint.
python:S5890 (MAJOR) schemas/sponsored_brands.py:23 Values assigned to variables should match their type annotations Assign to "bidOptimization" a value of type "bool" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/sponsored_brands.py:23 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "bool") . Code line: bidOptimization: bool = None
python:S5890 (MAJOR) schemas/sponsored_brands.py:24 Values assigned to variables should match their type annotations Assign to "bidMultiplier" a value of type "Decimal" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/sponsored_brands.py:24 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "Decimal") . Code line: bidMultiplier: Decimal = None
python:S5890 (MAJOR) schemas/sponsored_display.py:16 Values assigned to variables should match their type annotations Assign to "endDate" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/sponsored_display.py:16 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: endDate: str = None
python:S5890 (MAJOR) schemas/sponsored_display.py:19 Values assigned to variables should match their type annotations Assign to "portfolioId" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/sponsored_display.py:19 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: portfolioId: str = None
python:S5890 (MAJOR) schemas/sponsored_products.py:31 Values assigned to variables should match their type annotations Assign to "endDate" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) schemas/sponsored_products.py:31 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: endDate: str = None
python:mypy_valid_type (MINOR) source_amazon_ads/source.py:42 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...logger: AirbyteLogger, config: Mapping[str, Any]) -> Tuple[bool, any]:
python:mypy_assignment (MINOR) source_amazon_ads/source.py:48 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "AmazonAdsConfig", variable has type "Mapping[str, Any]") . Code line: config = AmazonAdsConfig(**config)
python:mypy_arg_type (MINOR) source_amazon_ads/source.py:54 Check argument types in calls Argument 1 to "Profiles" has incompatible type "Mapping[str, Any]"; expected "AmazonAdsConfig" . Code line: Profiles(config, authenticator=self._make_authenticator(config...
python:mypy_arg_type (MINOR) source_amazon_ads/source.py:54 Check argument types in calls Argument 1 to "_make_authenticator" of "SourceAmazonAds" has incompatible type "Mapping[str, Any]"; expected "AmazonAdsConfig" . Code line: ...s(config, authenticator=self._make_authenticator(config)).get_all_prof...
python:mypy_assignment (MINOR) source_amazon_ads/source.py:62 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "AmazonAdsConfig", variable has type "Mapping[str, Any]") . Code line: config = AmazonAdsConfig(**config)
python:mypy_arg_type (MINOR) source_amazon_ads/source.py:63 Check argument types in calls Argument 1 to "_make_authenticator" of "SourceAmazonAds" has incompatible type "Mapping[str, Any]"; expected "AmazonAdsConfig" . Code line: auth = self._make_authenticator(config)
python:mypy_import (MINOR) streams/common.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_override (MINOR) streams/common.py:172 Check that method override is compatible with base class Return type "Optional[int]" of "next_page_token" incompatible with return type "Optional[Mapping[str, Any]]" in supertype "AmazonAdsStream" . Code line: def next_page_token(self, response: requests.Response) -> Optional...
python:mypy_no_any_return (MINOR) streams/common.py:183 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Optional[int]" . Code line: return next_offset
python:mypy_import (MINOR) streams/profiles.py:7 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/profiles.py:20 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[Profile]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = Profile
python:mypy_has_type (MINOR) streams/profiles.py:27 Check that type of reference can be determined Cannot determine type of "model" . Code line: profile_id_obj = self.model.parse_obj(record)
python:mypy_has_type (MINOR) streams/profiles.py:48 Check that type of reference can be determined Cannot determine type of "model" . Code line: return [self.model.parse_obj(profile) for profile in self.read...
python:mypy_import (MINOR) report_streams/report_streams.py:17 Require that imported module can be found or has stubs Library stubs not installed for "pytz" (or incompatible with Python 3.9) . Code line: import pytz
python:mypy_import (MINOR) report_streams/report_streams.py:18 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) report_streams/report_streams.py:111 Check that attribute exists Module has no attribute "parse" . Code line: self._start_date = pendulum.parse(config.start_date).set(tz="U...
python:mypy_no_any_return (MINOR) report_streams/report_streams.py:116 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "CatalogModel" . Code line: return self._model
python:mypy_attr_defined (MINOR) report_streams/report_streams.py:382 Check that attribute exists "str" has no attribute "astimezone" . Code line: profile_time = report_date.astimezone(profile_tz)
python:mypy_no_any_return (MINOR) report_streams/report_streams.py:397 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "List[Dict[Any, Any]]" . Code line: return json.loads(raw_string)
python:mypy_assignment (MINOR) streams/sponsored_brands.py:16 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[BrandsCampaign]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = BrandsCampaign
python:mypy_assignment (MINOR) streams/sponsored_brands.py:29 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[BrandsAdGroup]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = BrandsAdGroup
python:mypy_assignment (MINOR) streams/sponsored_brands.py:42 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[BrandsAdGroup]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = BrandsAdGroup
python:mypy_assignment (MINOR) streams/sponsored_display.py:16 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[DisplayCampaign]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = DisplayCampaign
python:mypy_assignment (MINOR) streams/sponsored_display.py:29 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[DisplayAdGroup]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = DisplayAdGroup
python:mypy_assignment (MINOR) streams/sponsored_display.py:42 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[DisplayProductAds]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = DisplayProductAds
python:mypy_assignment (MINOR) streams/sponsored_display.py:55 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[DisplayTargeting]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = DisplayTargeting
python:mypy_assignment (MINOR) streams/sponsored_products.py:16 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[ProductCampaign]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = ProductCampaign
python:mypy_assignment (MINOR) streams/sponsored_products.py:29 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[ProductAdGroups]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = ProductAdGroups
python:mypy_assignment (MINOR) streams/sponsored_products.py:42 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[Keywords]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = Keywords
python:mypy_assignment (MINOR) streams/sponsored_products.py:55 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[NegativeKeywords]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = NegativeKeywords
python:mypy_assignment (MINOR) streams/sponsored_products.py:68 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[ProductAd]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = ProductAd
python:mypy_assignment (MINOR) streams/sponsored_products.py:81 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Type[ProductTargeting]", base class "BasicAmazonAdsStream" defined the type as "CatalogModel") . Code line: model = ProductTargeting

Coverage (98.8%)

File Coverage File Coverage
source_amazon_ads/init.py 100.0 source_amazon_ads/constants.py 100.0
source_amazon_ads/schemas/init.py 100.0 source_amazon_ads/schemas/common.py 100.0
source_amazon_ads/schemas/profile.py 100.0 source_amazon_ads/schemas/sponsored_brands.py 100.0
source_amazon_ads/schemas/sponsored_display.py 100.0 source_amazon_ads/schemas/sponsored_products.py 100.0
source_amazon_ads/source.py 97.1 source_amazon_ads/spec.py 100.0
source_amazon_ads/streams/init.py 100.0 source_amazon_ads/streams/common.py 98.7
source_amazon_ads/streams/profiles.py 100.0 source_amazon_ads/streams/report_streams/init.py 100.0
source_amazon_ads/streams/report_streams/brands_report.py 100.0 source_amazon_ads/streams/report_streams/brands_video_report.py 100.0
source_amazon_ads/streams/report_streams/display_report.py 100.0 source_amazon_ads/streams/report_streams/products_report.py 100.0
source_amazon_ads/streams/report_streams/report_streams.py 97.0 source_amazon_ads/streams/sponsored_brands.py 100.0
source_amazon_ads/streams/sponsored_display.py 100.0 source_amazon_ads/streams/sponsored_products.py 100.0

Please sign in to comment.