Skip to content

Commit

Permalink
fix(test_cases): test cases for pandas 3.0 (#1506)
Browse files Browse the repository at this point in the history
* fix: fixed duplicate export dynamics (#1399)

* chore: minor updates in the README (#1400)

* docs: update library.mdx (#1406)

Add 's' in the end of keyword "clarification_question"

agent.clarification_question('What is the GDP of the United States?')

* fix[#1415]: using torch 2.2.0 in macOS x86_64 (#1417)

* Add /app to PYTHONPATH

* fix for issue #1415

---------

Co-authored-by: Giuseppe Coco <[email protected]>

* chore: add /app to PYTHONPATH (#1416)

Co-authored-by: Giuseppe Coco <[email protected]>

* docs: update llms.mdx (#1410)

Add documentation of how to use pandasai.json file

* fix[output_format]: accept dataframe dict as output and secure sql qu… (#1432)

* fix[output_format]: accept dataframe dict as output and secure sql query execution

* fix: ruff errors

* chore[Security]: restrict libs to allow specific functionalities (#1429)

* chore[Security]: restrict libs to allow specific functionalities

* remove: extra lib handling

* fix: ruff errors

* fix: error message for bad import

* fix: add io library in the blacklist

* docs: update docs about customer whitelisted dependencies

* Release v2.4.0

* fix: update last_code_generated in smart_dataframe's __init__.py (#1484)

In SmartDataframe class the last_code_generated property returned _agent.last_code_executed instead of _agent.last_code_generated. In SmartDatalake it is implemented properly.

Co-authored-by: Bence Kecskés <[email protected]>

* Release v2.4.1

* fix: docker-compose-npm-error (#1486)

-Simplified the type of children to just React.ReactNode, which is the standard type for React components' children prop.

* fix: remove plt.show if exists in the generated code (#1501)

* fix: make seaborn as an optional dependency (#1500)

* fix: make seaborn as an optional dependency

* fix: linting errors

* fix: check if whitelisted lib is actually exists in the additional deps (#1499)

* feat(security): add security config to disable it (#1498)

* feat(security): add security config to disable it

* fix: linting errors

* fix(safety): push exact match for get attributes

* add additional test case

* fix: test case

* fix:  linting errors

* fix: linting errors

* docs(config): update config doc to add new config attribute

* Release v2.4.2

* fix(test_cases): handle and clean test cases of pandasai

* ruff changes

* add poetry lock file

* fix github ci workflow

* fix: extension deps installation

* fix: github workflows

* fix: unnecessary comments

* fix: ruff errors

* fix: ruff errors

* fix: typos

* fix ci yml file

* fix: ci

* fix make file for hardcoded env

* fix make file for hardcoded env

* fix make file for hardcoded env

* fix make file for hardcoded env

* fix: imports in extensions

* fix(testcases): extension test cases fixed

* fix: ci clear cache and suggested improvements

* clean up before running CI

* fix ci pipeline

* fix ci pipeline

* fix ci pipeline

* fix ci pipeline

* fix ci pipeline

* fix: ci

* fix: ci

* fix: ci

* fix github bug

* fix: CI

* fix: CI

* fix: test case on windows

* fix: test case on windows

* fix: test case on windows

* fix: test case on windows

* fix: CI

* feat(biqquery): add test cases for big query connector

* fix env issue of pandas not found

* fix: ci use pyproject

* fix: lock file

---------

Co-authored-by: AlessandroMarc <[email protected]>
Co-authored-by: Smoothengineer <[email protected]>
Co-authored-by: Muhammad Adam <[email protected]>
Co-authored-by: giuseppe-coco <[email protected]>
Co-authored-by: Giuseppe Coco <[email protected]>
Co-authored-by: Gabriele Venturi <[email protected]>
Co-authored-by: bencekecskes <[email protected]>
Co-authored-by: Bence Kecskés <[email protected]>
Co-authored-by: Charis Nikolaidis <[email protected]>
  • Loading branch information
10 people authored Jan 8, 2025
1 parent 366f8b8 commit 61fba95
Show file tree
Hide file tree
Showing 154 changed files with 2,983 additions and 5,976 deletions.
116 changes: 53 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry (Unix)
if: matrix.os != 'windows-latest'
run: |
Expand All @@ -37,90 +38,78 @@ jobs:
run: pip wheel --use-pep517 "future==0.18.3"
- name: Install dependencies
run: poetry install --all-extras --with dev --verbose
- name: Install extension dependencies
- name: Lint with ruff
run: make format_diff
- name: Spellcheck
run: make spell_check
- name: Run core tests
run: make test_core

# Install dependencies, test, and remove for each extension
- name: Install and test LLM extensions (Unix)
if: matrix.os != 'windows-latest'
run: |
# Install LLM extension dependencies
for dir in extensions/llms/*/; do
find extensions/llms -mindepth 1 -type d | while read -r dir; do
if [ -f "$dir/pyproject.toml" ]; then
echo "Installing dependencies for $dir"
cd "$dir"
poetry install --all-extras --with dev
cd -
(
cd "$dir" || exit
poetry install --all-extras --with test --verbose
)
echo "Running tests for $dir"
(
cd "$dir" || exit
poetry run pytest tests/
)
fi
done
# Install connector extension dependencies
for dir in extensions/connectors/*/; do
- name: Install and test Connector extensions (Unix)
if: matrix.os != 'windows-latest'
run: |
find extensions/connectors -mindepth 1 -type d | while read -r dir; do
if [ -f "$dir/pyproject.toml" ]; then
echo "Installing dependencies for $dir"
cd "$dir"
poetry install --all-extras --with dev
cd -
(
cd "$dir" || exit
poetry install --all-extras --with test --verbose
)
echo "Running tests for $dir"
(
cd "$dir" || exit
poetry run pytest tests/
)
fi
done
# Install enterprise extension dependencies
for dir in extensions/ee/*/*/; do
- name: Install and test Enterprise extensions (Unix)
if: matrix.os != 'windows-latest'
run: |
find extensions/ee -mindepth 1 -type d | while read -r dir; do
if [ -f "$dir/pyproject.toml" ]; then
echo "Installing dependencies for $dir"
cd "$dir"
poetry install --all-extras --with dev
cd -
(
cd "$dir" || exit
poetry install --all-extras --with test --verbose
)
echo "Running tests for $dir"
(
cd "$dir" || exit
poetry run pytest tests/
)
fi
done
- name: Install extension dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
# Install LLM extension dependencies
Get-ChildItem -Path extensions/llms -Directory | ForEach-Object {
$projFile = Join-Path $_.FullName "pyproject.toml"
if (Test-Path $projFile) {
Write-Host "Installing dependencies for $_"
Push-Location $_.FullName
poetry install --all-extras --with dev
Pop-Location
}
}
# Install connector extension dependencies
Get-ChildItem -Path extensions/connectors -Directory | ForEach-Object {
$projFile = Join-Path $_.FullName "pyproject.toml"
if (Test-Path $projFile) {
Write-Host "Installing dependencies for $_"
Push-Location $_.FullName
poetry install --all-extras --with dev
Pop-Location
}
}
# Install enterprise extension dependencies
Get-ChildItem -Path extensions/ee -Recurse -Directory -Depth 2 | ForEach-Object {
$projFile = Join-Path $_.FullName "pyproject.toml"
if (Test-Path $projFile) {
Write-Host "Installing dependencies for $_"
Push-Location $_.FullName
poetry install --all-extras --with dev
Pop-Location
}
}
- name: Lint with ruff
run: make format_diff
- name: Spellcheck
run: make spell_check
- name: Run core tests
run: make test_core
- name: Run extension tests
if: matrix.os != 'windows-latest'
run: make test_extensions
- name: Run extension tests (Windows)
if: matrix.os == 'windows-latest'
run: |
# Run LLM extension tests
Get-ChildItem -Path extensions/llms -Directory | ForEach-Object {
$testDir = Join-Path $_.FullName "tests"
if (Test-Path $testDir) {
Write-Host "Running tests for $_"
Write-Host "Running tests for $($_.FullName)"
Push-Location $_.FullName
poetry install --all-extras --with test --verbose
poetry run pytest tests/
Pop-Location
}
Expand All @@ -130,8 +119,9 @@ jobs:
Get-ChildItem -Path extensions/connectors -Directory | ForEach-Object {
$testDir = Join-Path $_.FullName "tests"
if (Test-Path $testDir) {
Write-Host "Running tests for $_"
Write-Host "Running tests for $($_.FullName)"
Push-Location $_.FullName
poetry install --all-extras --with test --verbose
poetry run pytest tests/
Pop-Location
}
Expand All @@ -141,9 +131,9 @@ jobs:
Get-ChildItem -Path extensions/ee -Recurse -Directory -Depth 2 | ForEach-Object {
$testDir = Join-Path $_.FullName "tests"
if (Test-Path $testDir) {
Write-Host "Running tests for $_"
Write-Host "Running tests for $($_.FullName)"
Push-Location $_.FullName
poetry run pytest tests/
poetry install --all-extras --with test --verbose
Pop-Location
}
}
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ all: help ## default target executed when no arguments are given to make
UNIT_TESTS_DIR ?= tests/unit_tests/
INTEGRATION_TESTS_DIR ?= tests/integration_tests/

setup_python: ## ensure we're using Python 3.10
@echo "Setting up Python 3.10..."
poetry env use python3.10
# setup_python: ## ensure we're using Python 3.10
# @echo "Setting up Python 3.10..."
# poetry env use python3.10

install_deps: setup_python ## install core dependencies
@echo "Installing core dependencies..."
Expand All @@ -26,23 +26,23 @@ install_extension_deps: setup_python ## install all extension dependencies
@for dir in extensions/llms/*/; do \
if [ -f "$$dir/pyproject.toml" ]; then \
echo "Installing dependencies for $$dir"; \
cd "$$dir" && poetry env use python3.10 && poetry install --all-extras --with test && cd - || exit 1; \
cd "$$dir" && poetry install --all-extras --with test && cd - || exit 1; \
fi \
done

@echo "Installing connector extension dependencies..."
@for dir in extensions/connectors/*/; do \
if [ -f "$$dir/pyproject.toml" ]; then \
echo "Installing dependencies for $$dir"; \
cd "$$dir" && poetry env use python3.10 && poetry install --all-extras --with test && cd - || exit 1; \
cd "$$dir" && poetry install --all-extras --with test && cd - || exit 1; \
fi \
done

@echo "Installing enterprise extension dependencies..."
@for dir in extensions/ee/*/*/; do \
if [ -f "$$dir/pyproject.toml" ]; then \
echo "Installing dependencies for $$dir"; \
cd "$$dir" && poetry env use python3.10 && poetry install --all-extras --with test && cd - || exit 1; \
cd "$$dir" && poetry install --all-extras --with test && cd - || exit 1; \
fi \
done

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
[![Downloads](https://static.pepy.tech/badge/pandasai)](https://pepy.tech/project/pandasai) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1ZnO-njhL7TBOYPZaqvMvGtsjckZKrv2E?usp=sharing)

PandasAI is a Python platform that makes it easy to ask questions to your data in natural language. It helps non-technical users to interact with their data in a more natural way, and it helps technical users to save time and effort when working with data.
PandasAI is a Python platform that makes it easy to ask questions to your data in natural language. It helps non-technical users to interact with their data in a more natural way, and it helps technical users to save time, and effort when working with data.

# 🚀 Deploying PandasAI

PandasAI can be used in a variety of ways. You can easily use it in your Jupyter notebooks or streamlit apps, or you can deploy it as a REST API such as with FastAPI or Flask.
PandasAI can be used in a variety of ways. You can easily use it in your Jupyter notebooks or Streamlit apps, or you can deploy it as a REST API such as with FastAPI or Flask.

If you are interested in the managed PandasAI Cloud or our self-hosted Enterprise Offering, [contact us](https://forms.gle/JEUqkwuTqFZjhP7h8).

# 🔧 Getting started

You can find the full documentation for PandasAI [here](https://pandas-ai.readthedocs.io/en/latest/).

You can either decide to use PandasAI in your Jupyter notebooks, streamlit apps, or use the client and server architecture from the repo.
You can either decide to use PandasAI in your Jupyter notebooks, Streamlit apps, or use the client and server architecture from the repo.

## ☁️ Using the platform

Expand Down
18 changes: 8 additions & 10 deletions client/app/(ee)/settings/logs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ import React from "react";
import { GetLogs } from "@/services/logs";
import LogsCard from "./logs-card";

export const dynamic = 'force-dynamic';
export const dynamic = "force-dynamic";

export default async function Logs() {
const data = await GetLogs();
const data = await GetLogs();

return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">Logs</h1>
<LogsCard logs={data?.logs || []} logs_count={data?.logs_count} />
</div>
);
return (
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">Logs</h1>
<LogsCard logs={data?.logs || []} logs_count={data?.logs_count} />
</div>
);
}
export const dynamic='force-dynamic';

44 changes: 21 additions & 23 deletions client/app/settings/datasets/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,32 @@ import Link from "next/link";
import DatasetCard from "./DatasetCard";
import { GetDatasetDetails } from "@/services/datasets";

export const dynamic = 'force-dynamic';
export const dynamic = "force-dynamic";

interface PageProps {
params: {
id: string;
};
params: {
id: string;
};
}

export default async function DatasetDetailsPage({ params }: PageProps) {
const data = await GetDatasetDetails(params.id);
const dataframe = data?.dataset;
const data = await GetDatasetDetails(params.id);
const dataframe = data?.dataset;

return (
<>
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">
<Link href="/settings/datasets">Datasets</Link>
<small>{` › ${dataframe?.name || ""}`}</small>
</h1>
return (
<>
<div className="w-full h-full overflow-y-auto custom-scroll mt-5 px-2 md:px-4">
<h1 className="text-2xl font-bold dark:text-white mb-10">
<Link href="/settings/datasets">Datasets</Link>
<small>{` › ${dataframe?.name || ""}`}</small>
</h1>

<div className="flex flex-col p-2 md:p-4 font-montserrat">
<div className="flex items-center justify-center w-[50%]">
<DatasetCard dataframe={dataframe} />
</div>
</div>
</div>
</>
);
<div className="flex flex-col p-2 md:p-4 font-montserrat">
<div className="flex items-center justify-center w-[50%]">
<DatasetCard dataframe={dataframe} />
</div>
</div>
</div>
</>
);
}
export const dynamic='force-dynamic';

Loading

0 comments on commit 61fba95

Please sign in to comment.