Skip to main content

A small package used to find data variances

Project description

Effulge

Use Case

  • When we have two pyspark dataframes with valid Primary Key
  • and we need to find the attributes that are mismatching between the two dataframes.

Example

Lets consider two dataframes "expectation" and "reality".

Inputs

If Primary Key is (ProductID, Colour) and if the contents of "expectation" are -

ProductIDProductNameColourUnitPriceQuantityFragileGift
1001GelPenBlue10200
1001GelPenBlack10100
1001GelPenRed10100
1002InkPenBlue50101
1003InkBottleBlue35111
1004PencilGrey3500
1005EraserWhite2200
1006SharpnerOrange3100
1006SharpnerSteel5100
1007GeometryBoxGreen4000

And if contents of "reality" are -

ProductIDProductNameColourUnitPriceQuantityFragileGift
1001GelPenBlue10200
1001GelPenBlack10700
1001GelPenRed10100
1002InkPenBlue50101
1003InkBottleBlue3110
1003WaterBottleBlue20200
1004PencilGrey3500
1005EraserWhiteee2200
1006SharpnerOrange3100
1006SharpnerSteel5100
1007GeometryBoxGreen4001

Output

Then, Effulge will produce an output dataframe with following contents -

productidcolourEFFULGE_VARIANCE_PROVOKER
1007Green[fragile]
1001Black[quantity]
1003Blue[fragile, gift, productname, quantity, unitprice]
1003Blue[gift, unitprice]
1005White[MISSING_PRIMARY_KEY]
1003Blue[DUPLICATE_PRIMARY_KEY]

Usage:

from effulge import spot_variance

# Initialize SparkSession
# Load data into dataframes, let's say they are called "df_expectation" and "df_reality"
# Declare a tuple with valid primary key, let's say it is called "primary_key"

output = spot_variance(df_expectation, df_reality, primary_key)
output.show()


# to generate variance report
from effulge import save_variance_report
save_variance_report(
    variance_df=output, source_df=df_expectation, target_df=df_reality,
    super_key=primary_key, file_name="effulge_variance_report",
    src_prefix='SRC', tgt_prefix='TGT'
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Effulge-0.0.1.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Effulge-0.0.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file Effulge-0.0.1.tar.gz.

File metadata

  • Download URL: Effulge-0.0.1.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.2

File hashes

Hashes for Effulge-0.0.1.tar.gz
Algorithm Hash digest
SHA256 59b0e098aae248e07cc3178214efe459680fb004db727abd876a611133b866fe
MD5 96ab3f2618d92bdcb5871259bfe8d6cf
BLAKE2b-256 fc04ce7a5650b784fe5492422efc89c2c0b8a4ee42604ddcaff5a7562b597b9c

See more details on using hashes here.

File details

Details for the file Effulge-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: Effulge-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.2

File hashes

Hashes for Effulge-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f914574dca24b6c024698fe3c9851b20de58ae9935b4dfb4718d9d3dabb46f63
MD5 c48cb6584d0716d7f8c2c9af6fc218ea
BLAKE2b-256 8c2a6d1e614361fdc4a06cb74fc9483cab90da4e1d0c20f48f462ef109d94c5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page