Skip to content

Commit

Permalink
Merge branch 'master' into 20784-dashboard-template-back
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaevg authored Apr 23, 2024
2 parents b30abe8 + d1f1691 commit f2775b0
Show file tree
Hide file tree
Showing 214 changed files with 10,627 additions and 8,051 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
'posthog',
'simple-import-sort',
'import',
"unused-imports"
],
rules: {
// PyCharm always adds curly braces, I guess vscode doesn't, PR reviewers often complain they are present on props that don't need them
Expand All @@ -73,6 +74,7 @@ module.exports = {
html: true,
},
],
"unused-imports/no-unused-imports": "error",
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
Expand Down
154 changes: 0 additions & 154 deletions .github/workflows/customer-data-pipeline.yml

This file was deleted.

File renamed without changes.
28 changes: 28 additions & 0 deletions bin/build-schema-python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -e

# Generate schema.py from schema.json
datamodel-codegen \
--class-name='SchemaRoot' --collapse-root-models --target-python-version 3.10 --disable-timestamp \
--use-one-literal-as-default --use-default --use-default-kwarg --use-subclass-enum \
--input frontend/src/queries/schema.json --input-file-type jsonschema \
--output posthog/schema.py --output-model-type pydantic_v2.BaseModel

# Format schema.py
ruff format posthog/schema.py

# Check schema.py and autofix
ruff check --fix posthog/schema.py

# HACK: Datamodel-codegen output for enum-type fields with a default is invalid – the default value is a plain string,
# and not the expected enum member. We fix this using sed, which is pretty hacky, but does the job.
# Specifically, we need to replace `Optional[PropertyOperator] = "exact"`
# with `Optional[PropertyOperator] = PropertyOperator("exact")` to make the default value valid.
# Remove this when https://github.com/koxudaxi/datamodel-code-generator/issues/1929 is resolved.
if [[ "$OSTYPE" == "darwin"* ]]; then
# sed needs `-i` to be followed by `''` on macOS
sed -i '' -e 's/Optional\[PropertyOperator\] = \("[A-Za-z_]*"\)/Optional[PropertyOperator] = PropertyOperator(\1)/g' posthog/schema.py
else
sed -i -e 's/Optional\[PropertyOperator\] = \("[A-Za-z_]*"\)/Optional[PropertyOperator] = PropertyOperator(\1)/g' posthog/schema.py
fi
1 change: 0 additions & 1 deletion cdp/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions cdp/.swcrc

This file was deleted.

82 changes: 0 additions & 82 deletions cdp/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions cdp/README.md

This file was deleted.

Loading

0 comments on commit f2775b0

Please sign in to comment.