Skip to main content

Pandas DataFrame Operators

Are a set of operators that can be implemented on SAP Data Hub/SAP Data Intelligence. These operators help to create Pandas DataFrames from CSV-strings or byte-encoded data.

Example graph with creating DataFrames, sampling, joining, selecting and creating CSV: Example pipeline: Create POS

The list of operators are constantly growing and will never be complete. In any case it should provide you the idea of how to develop quickly similar pandas operators that suits your requirements. At the end of the README.md you find a documention with common features and some practices of how it was developed.

More on the pandas project and the benefits it provides to high-performance data structures and analysis you find at https://pandas.pydata.org.

All operators have been developed locally and tested both locally and on an SAP Data Intelligence instance. For more information of how I have done it you find at sdi_utils and my blog on SAP Community platform.

Requirements

In order to be able to deploy and run the examples, the following requirements need to be fulfilled:

  • SAP Data Hub 2.3 or later installed on a supported platform or SAP Data Hub, trial edition 2.3
  • A docker-image with pandas package installed

Download and Installation

In the solution-folder you find the ready-to-import operators that will be stored under the path:

  • /files/vflow/subengines/com/sap/python36/operators/pandas

Examples

In the github folder example-graphs you find an example of how to use the operators.

Known Issues

Currently there are no known issues with the operators but nonetheless although all operators come with test cases and the code has limited complexities there might be errors that are not discovered yet. Notes of failing cases are well-appreciated.

How to get support

If you need help or in case you found a bug please open a Github Issue.

How to run

Import lastest release in /solution/PandasDataFrameOperators-0.0.x.zip via SAP Data Hub System Management -> Files -> Import Solution

License

This project is licensed under the MIT License

Documentation

Each operator folder has a README that should describe the behaviour of the operator.

Local Development Support

To work with the IDE of your choice and to run unit tests, you may start the development locally and do the appropriate tests before deploying the scripts in a SAP Data Hub / SAP Data Intelligence cluster. For doing this for all scripts supporting features are provided. There is also a hint for a simulation of a pipeline. Examples are given in the folder of /pipelines.

Basic Architecture

The communication is based on message.DataFrame where the body is linked to the DataFrame and the attributes provides some basic information like

  • number of columns
  • number of rows
  • index
  • column names
  • memory usage
  • data types of columns

The ports of communincating between pandas operators are type message.DataFrame to ensure a test of connecting operators on modeler level.

In addition there is a port 'log' that collects all logging statements and provided it as string.

Some common features

Memory

Because memory usage for big data is critical, fromCSV supports to select columns and to downcast datatypes. Open is the implementation of datatype category to reduce the memory of the extremely memory demanding strings. It is assumed that all data processing with the pandas operators runs in the same container. For crossing pods a streaming needs to be implemented or an intermediate saving of the results in an object store or a database and then reading it from other pods.

Communication between operators

For the communication the data type message is used where

  • attributes contains a basic profile of the DataFrame i(e.g. name, last_operator, number of rows and columns, message usage, data types, column names, ...).
  • body of the message contains the byte-encoded DataFrame.

The alternative of using a custom type was discarded because it is not supported within Python operators by providing and supporting the pre-defined structure. The only benefit is that in the Modeler the compatibility of the connections are checked.

Within a Python operator you can access the attributes of the message as a dictionary where as the body stores the pointer to the DataFrame.

Most of the di_pandas operators have 1 input dataport and 2 outputdata ports. The nomenclature is DataFrameMsg for the data message and Info for channeling infos to a terminal or a logging file for monitoring the graph behaviour while developing.

Metadata

Release files for sdi-pandas 0.0.37

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sdi-pandas 0.0.37
File Size Uploaded Provenance
sdi_pandas-0.0.37.tar.gz 28.6 kB Without provenance Details

Release files / sdi_pandas-0.0.37.tar.gz

Download URL sdi_pandas-0.0.37.tar.gz
Size 28.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ac594db7d928cee3f7bf93e6eb1c8bb082434d4c6433a4f8aaef68433505bb4b
BLAKE2b-256 checksum
How to use checksums
f144689164c4c1f148c9adf41a316877f9d7f5baca3c73760a974abea94f2527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

Security for sdi-pandas 0.0.37

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page