Skip to content

Commit

Permalink
Initial evidence project
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenwindflower committed Mar 16, 2024
1 parent f6baa57 commit dfdcc42
Show file tree
Hide file tree
Showing 15 changed files with 13,540 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .sqlfluff
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ capitalisation_policy = lower

[sqlfluff:rules:convention.select_trailing_comma]
select_clause_trailing_comma = require

[sqlfluff:rules:references.special_chars]
quoted_identifiers_policy = aliases
4 changes: 2 additions & 2 deletions models/marts/sf_trees.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ with

sf_trees as (

select * from {{ ref('stg_sf_trees') }}
select *, from {{ ref('stg_sf_trees') }}

)

select * from sf_trees
select *, from sf_trees
7 changes: 3 additions & 4 deletions models/marts/species.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ with

trees as (

select * from {{ ref('stg_sf_trees') }}
select *, from {{ ref('stg_sf_trees') }}

),

species as (

select
species,
count(*) as count_of_trees
count(*) as count_of_trees,

from trees

group by 1

)

select * from species

select *, from species
40 changes: 20 additions & 20 deletions models/staging/stg_sf_trees.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@ with

source as (

select * from {{ source('sf_trees', 'tree_list') }}
select *, from {{ source('sf_trees', 'tree_list') }}

),

staged as (

select
TreeID as tree_id,
qLegalStatus as legal_status,
qSpecies as species,
qAddress as address,
SiteOrder as site_order,
qSiteInfo as site_info,
PlantType as plant_type,
qCaretaker as caretaker,
qCareAssistant as care_assistant,
PlantDate as plant_date,
DBH as dbh,
PlotSize as plot_size,
PermitNotes as permit_notes,
XCoord as x_coord,
YCoord as y_coord,
Latitude as latitude,
Longitude as longitude,
Location as location,
treeid as tree_id,
qlegalstatus as legal_status,
qspecies as species,
qaddress as address,
siteorder as site_order,
qsiteinfo as site_info,
planttype as plant_type,
qcaretaker as caretaker,
qcareassistant as care_assistant,
plantdate as plant_date,
dbh,
plotsize as plot_size,
permitnotes as permit_notes,
xcoord as x_coord,
ycoord as y_coord,
latitude,
longitude,
location,
"Fire Prevention Districts" as fire_prevention_districts,
"Zip Codes" as zip_codes,
"Analysis Neighborhoods" as neighborhood,
from source

)

select * from staged
select *, from staged
1 change: 1 addition & 0 deletions reports/.evidence/customization/.profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"anonymousId":"b4e30dd2-96b3-4723-bd8b-5cdcaa3a6c23","traits":{"projectCreated":"2024-03-16T15:00:11.539Z"}}
4 changes: 4 additions & 0 deletions reports/.evidence/customization/custom-formatting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "1.0",
"customFormats": []
}
8 changes: 8 additions & 0 deletions reports/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.evidence/template
.svelte-kit
build
node_modules
.DS_Store
static/data
*.options.yaml
.vscode/settings.json
3 changes: 3 additions & 0 deletions reports/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
loglevel=error
audit=false
fund=false
56 changes: 56 additions & 0 deletions reports/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Evidence Template Project

Welcome to Evidence. Use this project template to get started.

## Get Started from VS Code

The easiest way to get started is using the [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=evidence-dev.evidence), which copies this template.

1. Install the extension from the VS Code Marketplace
2. Open the Command Palette (Ctrl/Cmd + Shift + P) and enter `Evidence: New Evidence Project`
3. Click `Start Evidence` in the bottom status bar

## Get Started using the CLI

```bash
npx degit evidence-dev/template my-project
cd my-project
npm install
npm run sources
npm run dev
```

Check out the docs for [alternative install methods](https://docs.evidence.dev/getting-started/install-evidence) including Docker, Github Codespaces, and alongside dbt.


## Codespaces

If you are using this template in Codespaces, click the `Start Evidence` button in the bottom status bar.

Alternatively, use the following commands to get started:

```bash
npm install
npm run sources
npm run dev -- --host 0.0.0.0
```

See [the CLI docs](https://docs.evidence.dev/cli/) for more command information.

**Note:** Codespaces is much faster on the Desktop app. After the Codespace has booted, select the hamburger menu → Open in VS Code Desktop.

## Connection Issues

If you see `✗ orders_by_month Missing database credentials`, you need to add the connection to the demo database:

1. Open the settings menu at [localhost:3000/settings](http://localhost:3000/settings)
2. select `DuckDB`
3. enter `needful_things`
4. select `.duckdb` and save

## Learning More

- [Docs](https://docs.evidence.dev/)
- [Github](https://github.com/evidence-dev/evidence)
- [Slack Community](https://slack.evidence.dev/)
- [Evidence Home Page](https://www.evidence.dev)
41 changes: 41 additions & 0 deletions reports/evidence.plugins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

components:
# This loads all of evidence's core charts and UI components
# You probably don't want to edit this dependency unless you know what you are doing
"@evidence-dev/core-components": {}

# Loading a plugin:
# your-component-plugin: {}
#
# Adding aliases:
# your-component-plugin:
# aliases:
# SomeLongComponent: Alias
#
# Adding overrides:
# your-component-plugin:
# aliases:
# SomeLongChartComponent: BarChart
# overrides:
# - BarChart
#
# Adding normal Svelte component library:
# your-svelte-component-library:
# provides:
# - SomeComponent
# - SomeOtherComponent
#
# For more info: https://docs.evidence.dev/plugins/using-plugins/
datasources:
# You can add additional datasources here by adding npm packages.
# Make to also add them to `package.json`.
"@evidence-dev/bigquery": { }
"@evidence-dev/csv": { }
"@evidence-dev/databricks": { }
"@evidence-dev/duckdb": { }
"@evidence-dev/mssql": { }
"@evidence-dev/mysql": { }
"@evidence-dev/postgres": { }
"@evidence-dev/snowflake": { }
"@evidence-dev/sqlite": { }
"@evidence-dev/trino": { }
Loading

0 comments on commit dfdcc42

Please sign in to comment.