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

chore: update for beta5 #65

Merged
merged 5 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
checks:
uses: ./.github/workflows/check.yml
with:
sdf_version: sdf-beta4
sdf_version: sdf-beta5
branch: ${{ github.ref }}

done:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
checks:
uses: ./.github/workflows/check.yml
with:
sdf_version: sdf-beta5-dev
sdf_version: sdf-beta6-dev
branch: ${{ github.ref }}
done:
name: Done
Expand Down
12 changes: 3 additions & 9 deletions dataflows/bank-processing/dataflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,10 @@ services:
DataOperation::DebitAccount(debit) => debit,
};

let accounts = account_balance();

let account = accounts.sql(&format!("select * from `account-balance` where name = '{}'", ev.name))?;
let account = sql(&format!("select * from `account-balance` where name = '{}'", ev.name))?;

let rows = accounts.rows()?;
let rows = account.rows()?;

if !rows.next() {
return Ok(None)
Expand Down Expand Up @@ -407,16 +406,11 @@ services:
- operator: filter-map
run: |
fn generate_overdraft_event_due_transfer(ev: DataEvent) -> Result<Option<OverdraftEvent>> {

let withdrawal = match ev.operation {
DataOperation::CreditAccount(_) => return Ok(None),
DataOperation::DebitAccount(debit) => debit,
};

let accounts = account_balance();

let account = accounts.sql(&format!("select * from `account-balance` where name = '{}'", ev.name))?;

let account = sql(&format!("select * from `account-balance` where name = '{}'", ev.name))?;
let rows = account.rows()?;

if !rows.next() {
Expand Down
3 changes: 1 addition & 2 deletions dataflows/car-processing/dataflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@ services:
- operator: filter-map
run: |
fn check_license_plate(car: Car) -> Result<Option<StolenPlate>> {
let plates = licence_plates();
let lp = plates.sql(&format!("select * from `licence-plates` where _key = '{}'", car.license))?;
let lp = sql(&format!("select * from licence_plates where _key = '{}'", car.license))?;
let rows = lp.rows()?;

let maker_col = lp.col("maker")?;
Expand Down
7 changes: 3 additions & 4 deletions dataflows/hackernews-notify/dataflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,11 @@ services:
run: |
fn match_words(article_data: ArticleData) -> Result<Option<(Option<String>, ArticleData)>> {
use format_sql_query::{Table, Column, QuotedData};
let table = notify_table();
let query = format!("SELECT * FROM `{}` WHERE {} = {}",
Table("notify-table".into()),
Table("notify_table".into()),
Column("_key".into()), QuotedData(&article_data.word.to_lowercase())
);
let emails = match table.sql(&query) {
let emails = match sql(&query) {
Ok(emails) => emails,
Err(e) => {
println!("Error: {}", e);
Expand Down Expand Up @@ -184,4 +183,4 @@ services:

sinks:
- type: topic
id: notify-event
id: notify-event
3 changes: 1 addition & 2 deletions dataflows/helsinki-transit/dataflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ services:
flush:
run: |
fn compute_top_vehicle() -> Result<TopVehicle> {
let mut stat = vehicle_stat();
let top5 = stat.sql("select * from vehicle_stat order by speed desc limit 5")?;
let top5 = sql("select * from vehicle_stat order by speed desc limit 5")?;
let rows = top5.rows()?;
let mut top_vehicles = vec![];
let key = top5.key()?;
Expand Down
2 changes: 1 addition & 1 deletion dataflows/mask-user-pii/package-variant/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ include $(BASE_DIR)/Makefile

e2e:
make -C $(BASE_DIR)/packages/mask-ssn build
$(SDF_BIN) run --skip-running --dev
$(SDF_BIN) run --skip-running
3 changes: 1 addition & 2 deletions dataflows/mask-user-pii/package-variant/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ Use the following command to compile the package:
Use `sdf` command line tool to run the dataflow:

```bash
sdf run --dev --ui
sdf run --ui
```

Where:
* `--dev` - runs the dataflow in development mode (reads the package from local file system).
* `--ui` - generates the graphical representation and run the Studio web server.


Expand Down
2 changes: 1 addition & 1 deletion dataflows/split-sentence/package-variant/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ include $(BASE_DIR)/Makefile

e2e:
make -C $(BASE_DIR)/packages/parse-sentence build
$(SDF_BIN) run --skip-running --dev
$(SDF_BIN) run --skip-running
3 changes: 1 addition & 2 deletions dataflows/split-sentence/package-variant/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ Use the following command to compile the package:
Use `sdf` command line tool to run the dataflow:

```bash
sdf run --dev --ui
sdf run --ui
```

Where:
* `--dev` - runs the dataflow in development mode (reads the package from local file system).
* `--ui` - generates the graphical representation and run the Studio web server.


Expand Down
3 changes: 1 addition & 2 deletions dataflows/word-counter/dataflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ services:
# Read the full state and compute the top 3 words sorted by count.
run: |
fn compute_most_used_words() -> Result<TopWords> {
let word_counts = count_per_word();

let top3 = word_counts.sql("select * from count_per_word order by count desc limit 3")?;
let top3 = sql("select * from count_per_word order by count desc limit 3")?;
let rows = top3.rows()?;
let columns = top3.schema(["_key","count"])?;

Expand Down
3 changes: 1 addition & 2 deletions dataflows/word-probe/dataflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ services:
- operator: map
run: |
fn query_word_count(word: String) -> Result<WordCount> {
let df = count_per_word();
let count = df.sql(&format!("select * from `count-per-word` where _key = '{}'", word))?;
let count = sql(&format!("select * from count_per_word where _key = '{}'", word))?;
let rows = count.rows()?;
let columns = count.schema(["_key","count"])?;
match &columns[..] {
Expand Down
Loading