Skip to content

Commit

Permalink
Merge branch 'master' into renovate/django-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulbrahmal authored Jul 28, 2021
2 parents 6d5e2ab + e31dda0 commit 373dba0
Show file tree
Hide file tree
Showing 8 changed files with 492 additions and 732 deletions.
90 changes: 77 additions & 13 deletions orchestrator/migrations/0002_data_migration_for_block_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def seed_blocks_into_registry(apps, schema_editor):
BlockRegistry(
block_type="DATA_BLOCK",
block_id=1,
block_name="Raw Data",
block_name="US Stock Data",
inputs=[
{
"fieldData": {
Expand All @@ -19,24 +19,44 @@ def seed_blocks_into_registry(apps, schema_editor):
"fieldName": "Equity Name",
"fieldType": "search",
"fieldVariableName": "equity_name",
}, # TODO: Change fieldType from dropdown to search
},
{
"fieldData": {"base": "/dataType", "method": "GET"},
"fieldName": "Data Type",
"fieldData": {"base": "/candlestick", "method": "GET"},
"fieldName": "Candlesticks",
"fieldType": "dropdown",
"fieldVariableName": "data_type",
"fieldVariableName": "candlestick",
},
{
"fieldData": {"base": "/interval", "method": "GET"},
"fieldName": "Interval",
"fieldType": "dropdown",
"fieldVariableName": "interval",
"fieldName": "Date Range",
"fieldType": "date_range",
"fieldVariableNames": ["start_date", "end_date"],
},
],
validations={
"input": {"required": [], "allowed_blocks": []},
"output": [{"blockType": "DATA_BLOCK", "number": 1}],
},
).save()

BlockRegistry(
block_type="DATA_BLOCK",
block_id=2,
block_name="Crypto Data",
inputs=[
{
"fieldData": {
"base": "/cryptoName?name=",
"method": "GET",
},
"fieldName": "Crypto Name",
"fieldType": "search",
"fieldVariableName": "crypto_name",
},
{
"fieldData": {"base": "/outputSize", "method": "GET"},
"fieldName": "Output Size",
"fieldData": {"base": "/candlestick", "method": "GET"},
"fieldName": "Candlesticks",
"fieldType": "dropdown",
"fieldVariableName": "outputsize",
"fieldVariableName": "candlestick",
},
{
"fieldName": "Date Range",
Expand Down Expand Up @@ -69,7 +89,10 @@ def seed_blocks_into_registry(apps, schema_editor):
validations={
"input": {
"required": [{"blockType": "DATA_BLOCK", "number": 1}],
"allowed_blocks": [{"blockId": "1", "blockType": "DATA_BLOCK"}],
"allowed_blocks": [
{"blockId": "1", "blockType": "DATA_BLOCK"},
{"blockId": "2", "blockType": "DATA_BLOCK"},
],
},
"output": [{"blockType": "COMPUTATIONAL_BLOCK", "number": 1}],
},
Expand Down Expand Up @@ -104,6 +127,45 @@ def seed_blocks_into_registry(apps, schema_editor):
},
).save()

BlockRegistry(
block_type="SIGNAL_BLOCK",
block_id=2,
block_name="Saddle",
inputs=[
{
"fieldData": {"base": "/saddleType", "method": "GET"},
"fieldName": "Saddle Type",
"fieldType": "dropdown",
"fieldVariableName": "saddle_type",
},
{
"fieldData": {"base": "/eventAction", "method": "GET"},
"fieldName": "Event Action",
"fieldType": "dropdown",
"fieldVariableName": "event_action",
},
{
"fieldName": "Consecutive Up",
"fieldVariableName": "consecutive_up",
"fieldType": "input",
},
{
"fieldName": "Consecutive Down",
"fieldVariableName": "consecutive_down",
"fieldType": "input",
},
],
validations={
"input": {
"required": [{"blockType": "COMPUTATIONAL_BLOCK", "number": 1}],
"allowed_blocks": [
{"blockId": "1", "blockType": "COMPUTATIONAL_BLOCK"}
],
},
"output": [{"blockType": "SIGNAL_BLOCK", "number": 2}],
},
).save()

BlockRegistry(
block_type="STRATEGY_BLOCK",
block_id=1,
Expand Down Expand Up @@ -148,7 +210,9 @@ def seed_blocks_into_registry(apps, schema_editor):
],
"allowed_blocks": [
{"blockId": "1", "blockType": "SIGNAL_BLOCK"},
{"blockId": "2", "blockType": "SIGNAL_BLOCK"},
{"blockId": "1", "blockType": "DATA_BLOCK"},
{"blockId": "2", "blockType": "DATA_BLOCK"},
],
},
"output": [{"blockType": "STRATEGY_BLOCK", "number": 1}],
Expand Down
6 changes: 0 additions & 6 deletions orchestrator/services/flow/run.py

This file was deleted.

Loading

0 comments on commit 373dba0

Please sign in to comment.