Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
58 changes: 47 additions & 11 deletions devnotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,58 @@ brew install [email protected]
python3 -m pip install -U tox build
```

### Configuring IntelliJ
### Install appropriate java, scala, and python versions
Recommend you do this through a runtime version manager. [asdf](https://asdf-vm.com/) recommended since it works for most all languages.

- Use scala`2.12` and java `corretto-17` for the Zipline Chronon distribution.

- Use scala `2.12.18` and java `corretto-8` for the OSS Chronon distribution.



Be sure to open the project from the `build.sbt` file (at the root level of the git directory).
### Clone the Chronon Repo

```bash
git clone [email protected]:zipline-ai/chronon.git
```

### Configuring IntelliJ

Mark the following directories as `Sources Root` by right clicking on the directory in the tree view, and selecting `Mark As` -> `Sources Root`:
- aggregator/src/main/scala
- api/src/main/scala
- spark/src/main/scala
- Open the project from the root `chronon` directory.
- Under File > Project Structure > Platform Settings, add java `corretto-17` and scala `scala-2.12.18` SDKs.
- Under Intellij IDEA > Settings > Editor > Code Style > Scala enable `scalafmt`.
- Follow the steps below to configure unit tests in intellij:

Run > Edit Configurations
![](./intellij_unit_test_1.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add alt text to images for accessibility

The images lack alt text, which is important for accessibility. Please add descriptive alt text to each image:

-![](./intellij_unit_test_1.png)
+![IntelliJ Run Configuration dialog showing test configuration settings](./intellij_unit_test_1.png)

-![](./intellij_unit_test_2.png)
+![IntelliJ VM options configuration showing Java arguments](./intellij_unit_test_2.png)

-![](./intellij_unit_test_3.png)
+![IntelliJ classpath configuration for module selection](./intellij_unit_test_3.png)

Also applies to: 73-73, 76-76

🧰 Tools
🪛 Markdownlint (0.35.0)

55-55: null
Images should have alternate text (alt text)

(MD045, no-alt-text)


Set the following [java arguments](https://stackoverflow.com/questions/72724816/running-unit-tests-with-spark-3-3-0-on-java-17-fails-with-illegalaccesserror-cl) by copy pasting into the run configuration arguments list:
```bash
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-opens=java.base/java.net=ALL-UNNAMED \
--add-opens=java.base/java.nio=ALL-UNNAMED \
--add-opens=java.base/java.util=ALL-UNNAMED \
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED \
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED \
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/sun.nio.cs=ALL-UNNAMED \
--add-opens=java.base/sun.security.action=ALL-UNNAMED \
--add-opens=java.base/sun.util.calendar=ALL-UNNAMED
```
![](./intellij_unit_test_2.png)

Then, set the classpath to `chronon/<module_name>`
![](./intellij_unit_test_3.png)
- Do the same for `ScalaTests` as well.
- Run an [example test](https://github.com/zipline-ai/chronon/blob/main/spark/src/test/scala/ai/chronon/spark/test/bootstrap/LogBootstrapTest.scala) in Chronon to verify that you’ve set things up correctly.

From CLI: `sbt "testOnly ai.chronon.spark.test.TableUtilsFormatTest"`


Mark the following directories as `Test Root` in a similar way:
- aggregator/src/test/scala
- api/src/test/scala
- spark/src/test/scala

The project should then automatically start indexing, and when it finishes you should be good to go.

**Troubleshooting**

Expand Down
Binary file added intellij_unit_test_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added intellij_unit_test_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added intellij_unit_test_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.