Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test_cases): test cases for pandas 3.0 #1506

Merged
merged 60 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e19da71
fix: fixed duplicate export dynamics (#1399)
AlessandroMarc Oct 18, 2024
48664d7
chore: minor updates in the README (#1400)
Smoothengineer Oct 20, 2024
c4478b5
docs: update library.mdx (#1406)
Muhammad-Adam1 Oct 22, 2024
30b2fa7
fix[#1415]: using torch 2.2.0 in macOS x86_64 (#1417)
giuseppe-coco Oct 29, 2024
f32bd0d
chore: add /app to PYTHONPATH (#1416)
giuseppe-coco Oct 29, 2024
719043c
docs: update llms.mdx (#1410)
Muhammad-Adam1 Oct 29, 2024
437f949
fix[output_format]: accept dataframe dict as output and secure sql qu…
ArslanSaleem Nov 18, 2024
27cb449
chore[Security]: restrict libs to allow specific functionalities (#1429)
ArslanSaleem Nov 20, 2024
0e4e1d0
docs: update docs about customer whitelisted dependencies
gventuri Nov 20, 2024
b809841
Release v2.4.0
gventuri Nov 20, 2024
34535a2
fix: update last_code_generated in smart_dataframe's __init__.py (#1484)
bence-kecskes Dec 18, 2024
68b6557
Release v2.4.1
gventuri Dec 18, 2024
daf5696
fix: docker-compose-npm-error (#1486)
Charisn Dec 19, 2024
d63f918
fix: remove plt.show if exists in the generated code (#1501)
ArslanSaleem Jan 2, 2025
63df017
fix: make seaborn as an optional dependency (#1500)
ArslanSaleem Jan 2, 2025
cfeb071
fix: check if whitelisted lib is actually exists in the additional de…
ArslanSaleem Jan 2, 2025
554a638
feat(security): add security config to disable it (#1498)
ArslanSaleem Jan 2, 2025
cf33faa
Release v2.4.2
gventuri Jan 2, 2025
f17fcea
Merge branch 'main' into merge_main/ci_fixes
ArslanSaleem Jan 7, 2025
52b04aa
fix(test_cases): handle and clean test cases of pandasai
ArslanSaleem Jan 8, 2025
6afb61d
ruff changes
ArslanSaleem Jan 8, 2025
28bb719
add poetry lock file
ArslanSaleem Jan 8, 2025
0be115f
Merge branch 'release/v3' into merge_main/ci_fixes
ArslanSaleem Jan 8, 2025
58fcff7
fix github ci workflow
ArslanSaleem Jan 8, 2025
b47f79e
fix: extension deps installation
ArslanSaleem Jan 8, 2025
ebb83a5
fix: github workflows
ArslanSaleem Jan 8, 2025
967118a
fix: unnecessary comments
ArslanSaleem Jan 8, 2025
dd61ab8
fix: ruff errors
ArslanSaleem Jan 8, 2025
07ce3cc
fix: ruff errors
ArslanSaleem Jan 8, 2025
b5e6a58
fix: typos
ArslanSaleem Jan 8, 2025
ffe986c
fix ci yml file
ArslanSaleem Jan 8, 2025
c2d6081
fix: ci
ArslanSaleem Jan 8, 2025
eb41a18
fix make file for hardcoded env
ArslanSaleem Jan 8, 2025
1afd565
fix make file for hardcoded env
ArslanSaleem Jan 8, 2025
b183fac
fix make file for hardcoded env
ArslanSaleem Jan 8, 2025
eac2c21
fix make file for hardcoded env
ArslanSaleem Jan 8, 2025
4d5f54c
fix: imports in extensions
ArslanSaleem Jan 8, 2025
b2ded79
fix(testcases): extension test cases fixed
ArslanSaleem Jan 8, 2025
466b079
fix: ci clear cache and suggested improvements
ArslanSaleem Jan 8, 2025
575f852
clean up before running CI
ArslanSaleem Jan 8, 2025
0c6e5ce
fix ci pipeline
ArslanSaleem Jan 8, 2025
9a29b78
fix ci pipeline
ArslanSaleem Jan 8, 2025
65cd422
fix ci pipeline
ArslanSaleem Jan 8, 2025
2cd2353
fix ci pipeline
ArslanSaleem Jan 8, 2025
def1433
fix ci pipeline
ArslanSaleem Jan 8, 2025
ee62baf
fix: ci
ArslanSaleem Jan 8, 2025
0958749
fix: ci
ArslanSaleem Jan 8, 2025
bcec071
fix: ci
ArslanSaleem Jan 8, 2025
2da1398
fix github bug
ArslanSaleem Jan 8, 2025
7570c2b
fix: CI
ArslanSaleem Jan 8, 2025
f2f15ce
fix: CI
ArslanSaleem Jan 8, 2025
f8e5f23
fix: test case on windows
ArslanSaleem Jan 8, 2025
59b42ed
fix: test case on windows
ArslanSaleem Jan 8, 2025
7e207eb
fix: test case on windows
ArslanSaleem Jan 8, 2025
3982c45
fix: test case on windows
ArslanSaleem Jan 8, 2025
ecafc64
fix: CI
ArslanSaleem Jan 8, 2025
64e51e3
feat(biqquery): add test cases for big query connector
ArslanSaleem Jan 8, 2025
4d84252
fix env issue of pandas not found
ArslanSaleem Jan 8, 2025
ea9a37d
fix: ci use pyproject
ArslanSaleem Jan 8, 2025
7c4119b
fix: lock file
ArslanSaleem Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup_python target is commented out but is still used as a dependency in install_deps and install_extension_deps. This will cause errors. Either uncomment setup_python or remove it as a dependency.

@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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArslanSaleem this new punctuation seems to be incorrect

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes looking at the test extension deps not getting installed in github flow


# 🚀 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
Loading