datalakehouse / dlh-square-analytics-dataform

DataLakeHouse Square Analytics on DataForm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Square package

This dataform package:

  • Contains a Dataform dimensional model based on Square from Datalakehouse’s connector.
  • The main use of this package is to provide a stable snowflake dimensional model that will provide useful insights.

Models

The primary ouputs of this package are fact and dimension tables as listed below. There are several intermediate models used to create these models.

Type Model Raw tables involved
Dimension W_SQR_CATALOG_ITEM_D CATALOG_CATEGORY
CATALOG_MODIFIER
CATALOG_ITEM_VARIATION
CATALOG_ITEM
ORDER_LINE_ITEM
Dimension W_SQR_CURRENCY_D Manually built
Dimension W_SQR_MERCHANT_LOCATION_D LOCATION
Dimension W_SQR_CUSTOMERS_D CUSTOMER
Fact W_SQR_ORDERS_F ORDER
ORDER_LINE_ITEM
ORDER_LINE_ITEM_MODIFIER
Fact W_SQR_PAYMENTS_F PAYMENT

For more information about Square's objects, use this URL.

Installation Instructions

Check for the latest installation instructions, if you don't have Dataform CLI installed yet.

Add the package to your packages.json file in your Dataform project. The last release of the package can be found on the releases page.

Configuration

By default, this package uses DEVELOPER_SANDBOX as the source database name and DEMO_SQUARE_ALT13 as schema name. If this is not the where your Square data is, change ther below variables configuration on your index.js file:

module.exports = (params) => {
  params = {
    source_database: 'DEVELOPER_SANDBOX',
    source_schema: 'DEMO_SQUARE_ALT13',
    target_schema: 'DATAFORM_SQUARE',
    ...params
  };

Create a new JS file on your definitions/ folder based with the folowing example:

const DATAFORM_SQUARE = require("../node_modules/dlh-dataform-square");
    
const models = DATAFORM_SQUARE({
});

Database support

Core:

  • Snowflake

Contributions

Additional contributions to this package are very welcome! Please create issues or open PRs against main. Check out this post on the best workflow for contributing to a package.

About

DataLakeHouse Square Analytics on DataForm

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%