Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Fake Snowflake Connector for Python. Run and mock Snowflake DB locally.
pip install fakesnow
Run script.py with fakesnow:
fakesnow script.py
Or a module, eg: pytest
fakesnow -m pytest
fakesnow
executes fakesnow.patch
before running the script or module.
To use fakesnow within your code:
import fakesnow
import snowflake.connector
with fakesnow.patch():
conn = snowflake.connector.connect()
print(conn.cursor().execute("SELECT 'Hello fake world!'").fetchone())
The following imports are automatically patched:
import snowflake.connector.connect
import snowflake.connector.pandas_tools.write_pandas
To patch modules that use the from ... import
syntax, manually specify them, eg: if mymodule.py has the import:
from snowflake.connector.pandas_tools import write_pandas
Then patch it using:
with fakesnow.patch("mymodule.write_pandas"):
...
By default databases are in-memory. To persist databases between processes, specify a databases path:
with fakesnow.patch(db_path="databases/"):
...
pytest fixtures are provided for testing. Example conftest.py:
from typing import Iterator
import fakesnow.fixtures
import pytest
pytest_plugins = fakesnow.fixtures.__name__
@pytest.fixture(scope="session", autouse=True)
def setup(_fakesnow_session: None) -> Iterator[None]:
# the standard imports are now patched
...
yield
Or with from ... import
patch targets:
from typing import Iterator
import fakesnow
import pytest
@pytest.fixture(scope="session", autouse=True)
def _fakesnow_session() -> Iterator[None]:
with fakesnow.patch("mymodule.write_pandas"):
yield
Partial support
For more detail see tests/test_fakes.py
See CONTRIBUTING.md to get started and develop in this repo.
FAQs
Fake Snowflake Connector for Python. Run, mock and test Snowflake DB locally.
We found that fakesnow demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.