Skip to content

Commit

Permalink
fix helper comment on functions generated with init CLI (#1991)
Browse files Browse the repository at this point in the history
  • Loading branch information
03cranec authored Jan 14, 2025
1 parent 0eb00bd commit 07a740c
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion apps/framework-cli/src/framework/python/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ my_function = StreamingFunction(
"#;

pub static PYTHON_BASE_STREAMING_FUNCTION_TEMPLATE: &str = r#"
# Add your models & start the development server to import these types
# Import your Moose data models to use in the streaming function
{{source_import}}
{{destination_import}}
from moose_lib import StreamingFunction
Expand Down
8 changes: 4 additions & 4 deletions apps/framework-cli/src/framework/streaming/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ mod tests {
assert_eq!(
result,
r#"
// Add your models & start the development server to import these types
// Import your Moose data models to use in the streaming function
import { Foo, Bar } from "datamodels/models";
Expand Down Expand Up @@ -301,7 +301,7 @@ export default function run(source: Foo): Bar | null {
assert_eq!(
result,
r#"
// Add your models & start the development server to import these types
// Import your Moose data models to use in the streaming function
import { UserActivity, ParsedActivity } from "datamodels/models";
Expand Down Expand Up @@ -366,7 +366,7 @@ export default function run(source: UserActivity): ParsedActivity | null {
assert_eq!(
result,
r#"
// Add your models & start the development server to import these types
// Import your Moose data models to use in the streaming function
import { UserActivity as UserActivityOld } from "versions/0.0/models";
import { UserActivity } from "datamodels/models";
Expand Down Expand Up @@ -426,7 +426,7 @@ export default function run(source: UserActivityOld): UserActivity | null {
assert_eq!(
result,
r#"
# Add your models & start the development server to import these types
# Import your Moose data models to use in the streaming function
from v0_0.models import UserActivity as UserActivityOld
from app.datamodels.models import UserActivity
from moose_lib import StreamingFunction
Expand Down
2 changes: 1 addition & 1 deletion apps/framework-cli/src/framework/typescript/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function run(source: UserActivity): ParsedActivity {
"#;

pub static TS_BASE_STREAMING_FUNCTION_TEMPLATE: &str = r#"
// Add your models & start the development server to import these types
// Import your Moose data models to use in the streaming function
{{source_import}}
{{destination_import}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default function run(source: RawStarEvent): StargazerProjectInfo | null {

<Python>
```py filename="functions/RawStarEvent__StargazerProjectInfo.py" copy
# Add your models & start the development server to import these types
# Import your Moose data models to use in the streaming function
from app.datamodels.RawStarEvent import RawStarEvent
from app.datamodels.StargazerProjectInfo import StargazerProjectInfo
from moose_lib import StreamingFunction
Expand Down Expand Up @@ -289,7 +289,7 @@ async function callGitHubAPI(url: string): Promise<any> {
Replace the boilerplace `fn()` function with the following code to enrich the data:

```python filename="functions/RawStarEvent__StargazerProjectInfo.py" copy
# Add your models & start the development server to import these types
# Import your Moose data models to use in the streaming function
from app.datamodels.RawStarEvent import RawStarEvent
from app.datamodels.StargazerProjectInfo import StargazerProjectInfo
from moose_lib import StreamingFunction, cli_log, CliLogData
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Add your models & start the development server to import these types
// Import your Moose data models to use in the streaming function
import {
MooseActivity,
MooseActivityAugmented,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Add your models & start the development server to import these types
// Import your Moose data models to use in the streaming function
import {
MooseSessionTelemetry,
MooseSessionTelemetryAugmented,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Add your models & start the development server to import these types
// Import your Moose data models to use in the streaming function
import { PageViewEvent, PageViewProcessed } from "../../../datamodels/models";
import { gatherIpData } from "../../../lib/ipAugmentation";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Add your models & start the development server to import these types
# Import your Moose data models to use in the streaming function
from app.datamodels.HistoricalStargazer import HistoricalStargazer
from app.datamodels.StargazerProjectInfo import StargazerProjectInfo
from moose_lib import StreamingFunction, cli_log, CliLogData
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Add your models & start the development server to import these types
# Import your Moose data models to use in the streaming function
from app.datamodels.RawStarEvent import RawStarEvent
from app.datamodels.StargazerProjectInfo import StargazerProjectInfo
from moose_lib import StreamingFunction, cli_log, CliLogData
Expand Down
2 changes: 1 addition & 1 deletion templates/logs/moose/app/flows/RawLog/Log/flow.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Add your models & start the development server to import these types
// Import your Moose data models to use in the streaming function
import { Log } from "../../../datamodels/models";
import { RawLog, AnyValue, KeyValue } from "../../../otel"; // not great

Expand Down

0 comments on commit 07a740c

Please sign in to comment.