def requires(self):
        kwargs = {
            'destination': self.destination,
            'num_mappers': self.num_mappers,
            'verbose': self.verbose,
            'import_date': self.import_date,
            'overwrite': self.overwrite,
            'credentials': self.otto_credentials,
            'database': self.otto_database,
        }
        yield (
            # Otto User Table
            ImportEcommerceUser(**kwargs),

            # Otto Product Tables.
            ImportProductCatalog(**kwargs),
            ImportProductCatalogClass(**kwargs),
            ImportProductCatalogAttributes(**kwargs),
            ImportProductCatalogAttributeValues(**kwargs),

            # Otto Current State, Line Item, and Coupon Tables.
            ImportCurrentOrderState(**kwargs),
            ImportCurrentOrderLineState(**kwargs),

            # Otto Refund Tables.
            ImportCurrentRefundRefundLineState(**kwargs),

            # Otto Partner Information.
            ImportEcommercePartner(**kwargs),
        )
    def requires(self):
        kwargs = {
            'destination': self.destination,
            'num_mappers': self.num_mappers,
            'verbose': self.verbose,
            'import_date': self.import_date,
            'overwrite': self.overwrite,
            'credentials': self.otto_credentials,
            'database': self.otto_database,
        }
        yield (
            # Otto User Table
            ImportEcommerceUser(**kwargs),

            # Otto Product Tables.
            ImportProductCatalog(**kwargs),
            ImportProductCatalogClass(**kwargs),
            ImportProductCatalogAttributes(**kwargs),
            ImportProductCatalogAttributeValues(**kwargs),

            # Otto Current State, Line Item, and Coupon Tables.
            ImportCurrentOrderState(**kwargs),
            ImportCurrentOrderLineState(**kwargs),
            ImportCurrentOrderDiscountState(**kwargs),
            ImportCouponVoucherIndirectionState(**kwargs),
            ImportCouponVoucherState(**kwargs),

            # Otto Refund Tables.
            ImportCurrentRefundRefundLineState(**kwargs),

            # Otto Partner Information.
            ImportEcommercePartner(**kwargs),
        )

        kwargs['credentials'] = self.credentials
        kwargs['database'] = self.database
        yield (
            # Shopping cart tables.
            ImportShoppingCartOrder(**kwargs),
            ImportShoppingCartOrderItem(**kwargs),
            ImportShoppingCartCertificateItem(**kwargs),
            ImportShoppingCartPaidCourseRegistration(**kwargs),
            ImportShoppingCartDonation(**kwargs),
            ImportShoppingCartCourseRegistrationCodeItem(**kwargs),
            ImportShoppingCartCoupon(**kwargs),
            ImportShoppingCartCouponRedemption(**kwargs),

            # Other LMS tables.
            ImportAuthUserTask(**kwargs),
            ImportCourseEntitlementTask(**kwargs),
            ImportStudentCourseEnrollmentTask(**kwargs),
        )
Пример #3
0
    def requires(self):  # pragma: no cover
        for requirement in super(EnterpriseEnrollmentDataTask, self).requires():
            yield requirement

        # the process that generates the source table used by this query
        yield (
            ImportAuthUserTask(),
            ImportAuthUserProfileTask(),
            ImportEnterpriseCustomerTask(),
            ImportEnterpriseCustomerUserTask(),
            ImportEnterpriseCourseEnrollmentUserTask(),
            ImportDataSharingConsentTask(),
            ImportUserSocialAuthTask(),
            ImportStudentCourseEnrollmentTask(),
            ImportPersistentCourseGradeTask(),
            CoursePartitionTask(
                date=self.date,
                warehouse_path=self.warehouse_path,
                api_root_url=self.api_root_url,
                api_page_size=self.api_page_size,
            ),
            UserActivityTableTask(
                warehouse_path=self.warehouse_path,
                overwrite_n_days=0,
                date=self.date
            ),
            ExternalCourseEnrollmentSummaryPartitionTask(
                date=self.date
            ),
        )

        kwargs = {
            'credentials': self.otto_credentials,
            'database': self.otto_database,
        }
        yield (
            ImportProductCatalog(**kwargs),
            ImportCurrentOrderLineState(**kwargs),
            ImportCurrentOrderDiscountState(**kwargs),
            ImportVoucherTask(**kwargs),
            ImportStockRecordTask(**kwargs),
            ImportCurrentOrderState(**kwargs),
            ImportEcommerceUser(**kwargs),
            ImportConditionalOfferTask(**kwargs),
            ImportBenefitTask(**kwargs),
        )