Skip to content

Commit

Permalink
Update deps (#964)
Browse files Browse the repository at this point in the history
* dependency-updates

* frontend dep updates

* update pre-commit

* Fix code style issues with ESLint

* bump frontend react-instantsearch

* numpy <2

* react-instantsearch

* Fix code style issues with ESLint

* test warning fix

* Fix code style issues with ESLint

* fix snowflake config bug

* update cli to better handle compose

---------

Co-authored-by: Lint Action <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ieaves and github-actions[bot] authored Aug 30, 2024
1 parent 785aa55 commit dec4adf
Show file tree
Hide file tree
Showing 26 changed files with 16,654 additions and 8,743 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# configure shared hooks that you want to run on all repositories here
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -26,7 +26,7 @@ repos:
# - flake8-simplify

- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.8.0
hooks:
- id: black
description: "Black: The uncompromising Python code formatter"
Expand Down
2 changes: 1 addition & 1 deletion grai-cli/grai_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
settings.cache.cache.set("first_install", False)
utilities.telemetry.Telemetry.capture("First install")

__version__ = "0.2.6"
__version__ = "0.2.7"
2 changes: 1 addition & 1 deletion grai-cli/grai_cli/api/demo/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, file: Optional[str] = None, url: Optional[str] = None):
def check_for_docker_and_docker_compose():
try:
docker_version = subprocess.check_output(["docker", "--version"], text=True)
docker_compose_version = subprocess.check_output(["docker-compose", "--version"], text=True)
docker_compose_version = subprocess.check_output(["docker", "compose", "--version"], text=True)
except subprocess.CalledProcessError as e:
raise Exception(
"Docker and/or Docker Compose is not installed. You can find more information about installing docker "
Expand Down
415 changes: 202 additions & 213 deletions grai-cli/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion grai-cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "grai-cli"
version = "0.2.6"
version = "0.2.7"
description = ""
authors = ["Ian Eaves <[email protected]>"]
license = "Elastic-2.0"
Expand Down
2 changes: 1 addition & 1 deletion grai-cli/tests/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_compose_script_is_valid(self):
temp.write(self.demo.compose_script.encode())

try:
result = subprocess.run(["docker-compose", "-f", temp.name, "config"], capture_output=True, text=True)
result = subprocess.run(["docker", "compose", "-f", temp.name, "config"], capture_output=True, text=True)
finally:
os.unlink(temp.name)
assert result.returncode == 0, result.stderr
Expand Down
384 changes: 187 additions & 197 deletions grai-client/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion grai-client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pytest = "^7.2.0"
types-requests = "^2.28.11.5"
types-pyyaml = "^6.0.12.2"
pre-commit = "^2.20.0"
pdoc = "^13.1.1"
pdoc = "^14.5.1"
pytest-durations = "^1.2.0"
toml = "^0.10.2"

Expand Down
20,799 changes: 14,195 additions & 6,604 deletions grai-frontend/package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions grai-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grai-frontend",
"version": "0.1.5",
"version": "0.1.6",
"private": true,
"dependencies": {
"@algolia/autocomplete-js": "^1.8.3",
Expand All @@ -26,6 +26,7 @@
"@types/node": "^16.18.2",
"@types/react": "^18.0.23",
"@types/react-dom": "^18.0.7",
"@types/react-instantsearch": "^6.10.4",
"@types/react-router-dom": "^5.3.3",
"@types/react-syntax-highlighter": "^15.5.10",
"@typescript-eslint/parser": "^6.0.0",
Expand Down Expand Up @@ -55,7 +56,8 @@
"react-dropzone": "^14.2.3",
"react-helmet": "^6.1.0",
"react-helmet-async": "^1.3.0",
"react-instantsearch-hooks-web": "^6.41.0",
"react-instantsearch": "^6.21.0",
"react-instantsearch-hooks": "^6.47.3",
"react-json-view-lite": "^1.1.0",
"react-markdown": "^9.0.0",
"react-qr-code": "^2.0.12",
Expand Down
39 changes: 35 additions & 4 deletions grai-frontend/src/components/connections/ConnectionDelete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,37 @@ const ConnectionDelete: React.FC<ConnectionDeleteProps> = ({
},
})

const handleDelete = () => {
onClose()
// const handleDelete = () => {
// onClose()
// confirm({
// title: "Delete Connection",
// description: (
// <>
// <Typography component="span" sx={{ display: "block", mb: 2 }}>
// Are you sure you wish to delete the {connection.name} connection?
// </Typography>
// {connection.runs.meta.total > 0 && (
// <Typography component="span">
// Deleting this source will also delete {connection.runs.meta.total}{" "}
// run{connection.runs.meta.total > 1 ? "s" : ""}.
// </Typography>
// )}
// </>
// ),
// confirmationText: "Delete",
// })
// .then(() => deleteConnection())
// .then(() => enqueueSnackbar("Connection deleted", { variant: "success" }))
// .then(onDelete)
// .catch(
// error =>
// error &&
// enqueueSnackbar(`Failed to delete connection ${error}`, {
// variant: "error",
// }),
// )
// }
const handleDelete = () => {
confirm({
title: "Delete Connection",
description: (
Expand All @@ -90,7 +119,10 @@ const ConnectionDelete: React.FC<ConnectionDeleteProps> = ({
),
confirmationText: "Delete",
})
.then(() => deleteConnection())
.then(() => {
onClose() // Move onClose here
return deleteConnection()
})
.then(() => enqueueSnackbar("Connection deleted", { variant: "success" }))
.then(onDelete)
.catch(
Expand All @@ -101,7 +133,6 @@ const ConnectionDelete: React.FC<ConnectionDeleteProps> = ({
}),
)
}

return (
<MenuItem onClick={handleDelete}>
<ListItemIcon>
Expand Down
66 changes: 37 additions & 29 deletions grai-frontend/src/components/filters/FiltersMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,44 @@ const FiltersMenu: React.FC<FiltersMenuProps> = ({
edit,
}) => (
<PopupState variant="popover">
{popupState => (
<>
<IconButton size="small" {...bindTrigger(popupState)}>
<MoreHoriz />
</IconButton>
{popupState => {
// Create a handler function that matches the expected type for onClose
const handleDeleteClose = (deleted: boolean) => {
// You can handle the 'deleted' boolean as needed
popupState.close(); // Call the original close method without arguments
};

<Menu
{...bindMenu(popupState)}
PaperProps={{
sx: {
width: 200,
},
}}
>
{edit && (
<MenuItem component={Link} to={filter.id}>
<ListItemIcon>
<Edit />
</ListItemIcon>
<ListItemText primary="Edit" />
</MenuItem>
)}
<FilterDelete
filter={filter}
onClose={popupState.close}
workspaceId={workspaceId}
/>
</Menu>
</>
)}
return (
<>
<IconButton size="small" {...bindTrigger(popupState)}>
<MoreHoriz />
</IconButton>

<Menu
{...bindMenu(popupState)}
PaperProps={{
sx: {
width: 200,
},
}}
>
{edit && (
<MenuItem component={Link} to={filter.id}>
<ListItemIcon>
<Edit />
</ListItemIcon>
<ListItemText primary="Edit" />
</MenuItem>
)}
<FilterDelete
filter={filter}
onClose={handleDeleteClose} // Use the new handler function
workspaceId={workspaceId}
/>
</Menu>
</>
)
}}
</PopupState>
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { act } from "react"
import userEvent from "@testing-library/user-event"
import { GraphQLError } from "graphql"
import { act } from "react-dom/test-utils"
import { render, screen } from "testing"
import FilterControl, { GET_FILTERS } from "./FilterControl"

Expand Down
4 changes: 2 additions & 2 deletions grai-frontend/src/components/search/SearchContainer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {
useInstantSearch,
useHits,
useSearchBox,
} from "react-instantsearch-hooks-web"
} from "react-instantsearch-hooks"
import { act, render, screen, waitFor } from "testing"
import SearchContainer, { GET_SEARCH_KEY } from "./SearchContainer"

const onClose = jest.fn()

jest.mock("react-instantsearch-hooks-web", () => ({
jest.mock("react-instantsearch-hooks", () => ({
InstantSearch: ({ children }: { children: ReactNode }) => children,
useHits: jest.fn(),
useSearchBox: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion grai-frontend/src/components/search/SearchContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import { gql, useQuery } from "@apollo/client"
import algoliasearch from "algoliasearch/lite"
import { InstantSearch } from "react-instantsearch-hooks-web"
import { InstantSearch } from "react-instantsearch-core"
import Loading from "components/layout/Loading"
import GraphError from "components/utils/GraphError"
import {
Expand Down
2 changes: 1 addition & 1 deletion grai-frontend/src/components/search/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
useHits,
useSearchBox,
useInstantSearch,
} from "react-instantsearch-hooks-web"
} from "react-instantsearch-hooks"
import useWorkspace from "helpers/useWorkspace"
import SearchHitRow, { SearchHit } from "./SearchHitRow"
import SearchTextbox from "./SearchTextbox"
Expand Down
2 changes: 1 addition & 1 deletion grai-frontend/src/components/search/SearchHitRow.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ReactNode } from "react"
import { render } from "testing"
import SearchHitRow from "./SearchHitRow"

jest.mock("react-instantsearch-hooks-web", () => ({
jest.mock("react-instantsearch", () => ({
InstantSearch: ({ children }: { children: ReactNode }) => children,
useHits: () => ({ hits: [] }),
useSearchBox: () => ({
Expand Down
2 changes: 1 addition & 1 deletion grai-frontend/src/components/search/SearchTextbox.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import { Close, Search } from "@mui/icons-material"
import { Box, Button, InputAdornment, TextField } from "@mui/material"
import { useSearchBox } from "react-instantsearch-hooks-web"
import { useSearchBox } from "react-instantsearch-hooks"

type SearchTextboxProps = {
onClose: () => void
Expand Down
2 changes: 1 addition & 1 deletion grai-frontend/src/pages/Home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Workspaces, { GET_WORKSPACES } from "./workspaces/Workspaces"

window.scrollTo = jest.fn()

// jest.mock("react-instantsearch-hooks-web", () => ({
// jest.mock("react-instantsearch", () => ({
// InstantSearch: ({ children }: { children: ReactNode }) => children,
// useHits: () => ({ hits: [] }),
// useSearchBox: () => ({
Expand Down
3 changes: 2 additions & 1 deletion grai-frontend/src/pages/connections/Connection.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { act } from 'react';
import userEvent from "@testing-library/user-event"
import { GraphQLError } from "graphql"
import { act, render, screen } from "testing"
import { render, screen } from "testing"
import { DELETE_CONNECTION } from "components/connections/ConnectionDelete"
import { RUN_CONNECTION } from "components/connections/ConnectionRun"
import Connection, { GET_CONNECTION } from "./Connection"
Expand Down
Loading

0 comments on commit dec4adf

Please sign in to comment.