Skip to content

Commit 0cf6465

Browse files
committed
fix lint and revert jdk changes
1 parent 88bdc28 commit 0cf6465

File tree

9 files changed

+19
-25
lines changed

9 files changed

+19
-25
lines changed

.github/workflows/pr-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up JDK
2020
uses: actions/setup-java@v4
2121
with:
22-
java-version: "11"
22+
java-version: "8"
2323
distribution: 'zulu'
2424
cache: 'sbt'
2525

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up JDK
2424
uses: actions/setup-java@v4
2525
with:
26-
java-version: "11"
26+
java-version: "8"
2727
distribution: "zulu"
2828
cache: "sbt"
2929

@@ -89,7 +89,7 @@ jobs:
8989
- name: Set up JDK
9090
uses: actions/setup-java@v4
9191
with:
92-
java-version: "11"
92+
java-version: "8"
9393
distribution: "zulu"
9494
cache: "sbt"
9595

@@ -125,7 +125,7 @@ jobs:
125125
strategy:
126126
fail-fast: false
127127
matrix:
128-
java: ["11", "17", "21"]
128+
java: ["8", "11", "17", "21"]
129129
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
130130

131131
steps:
@@ -172,7 +172,7 @@ jobs:
172172
- name: Set up JDK
173173
uses: actions/setup-java@v4
174174
with:
175-
java-version: "11"
175+
java-version: "8"
176176
distribution: "zulu"
177177
cache: "sbt"
178178

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The project is mainly divided into 2 submodules,
3939

4040
## Compatibility
4141

42-
- JDK version `>=11`
42+
- JDK version `>=8`
4343
- Scala version `2.12.x`, `2.13.x` and `3.3.x`. Default is `2.13.x`
4444
- Rust version `>=1.58`
4545

@@ -49,7 +49,7 @@ The project is mainly divided into 2 submodules,
4949

5050
The following tooling is required to start building `scala-polars`,
5151

52-
- JDK 11+ ([OpenJDK](https://openjdk.org/projects/jdk/)
52+
- JDK 8+ ([OpenJDK](https://openjdk.org/projects/jdk/)
5353
or [Oracle Java SE](https://www.oracle.com/java/technologies/javase/))
5454
- [Rust](https://www.rust-lang.org/tools/install) (cargo, rustc etc.)
5555
- [sbt](https://www.scala-sbt.org/index.html)

native/src/internal_jni/expr/literal.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ pub fn fromDate(mut env: JNIEnv, _: JClass, value: JString) -> jlong {
6969

7070
let date = NaiveDate::parse_from_str(string_value.as_str(), "%Y-%m-%d")
7171
.context(format!(
72-
"Failed to parse value `{}` as date with format `%Y-%m-%d`",
73-
string_value
72+
"Failed to parse value `{string_value}` as date with format `%Y-%m-%d`"
7473
))
7574
.unwrap_or_throw(&mut env);
7675

@@ -88,8 +87,7 @@ pub fn fromTime(mut env: JNIEnv, _: JClass, value: JString) -> jlong {
8887

8988
let time = NaiveTime::parse_from_str(string_value.as_str(), "%H:%M:%S%.f")
9089
.context(format!(
91-
"Failed to parse value `{}` as time with format `%H:%M:%S%.f`",
92-
string_value
90+
"Failed to parse value `{string_value}` as time with format `%H:%M:%S%.f`"
9391
))
9492
.unwrap_or_throw(&mut env);
9593

@@ -110,8 +108,7 @@ pub fn fromDateTime(mut env: JNIEnv, _: JClass, value: JString) -> jlong {
110108

111109
let datetime = NaiveDateTime::parse_from_str(string_value.as_str(), "%FT%T%.f")
112110
.context(format!(
113-
"Failed to parse value `{}` as datetime with format `%FT%T%.f`",
114-
string_value
111+
"Failed to parse value `{string_value}` as datetime with format `%FT%T%.f`"
115112
))
116113
.unwrap_or_throw(&mut env);
117114

native/src/internal_jni/frame.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub unsafe fn schemaString(mut env: JNIEnv, _: JClass, df_ptr: *mut DataFrame) -
2626
#[jni_fn("org.polars.scala.polars.internal.jni.data_frame$")]
2727
pub unsafe fn show(_: JNIEnv, _: JClass, df_ptr: *mut DataFrame) {
2828
let df = &mut *df_ptr;
29-
println!("{:?}", df)
29+
println!("{df:?}")
3030
}
3131

3232
#[jni_fn("org.polars.scala.polars.internal.jni.data_frame$")]

native/src/internal_jni/row.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'a> RowIterator<'a> {
9191
}
9292
}
9393

94-
pub fn advance(&mut self) -> Option<Vec<AnyValue>> {
94+
pub fn advance(&mut self) -> Option<Vec<AnyValue<'_>>> {
9595
if self.start < self.end {
9696
let start_index = self.start * self.width;
9797
let end_index = (self.start + 1) * self.width;

native/src/internal_jni/series.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ pub unsafe fn new_date_series(
137137
.map(|s| {
138138
let lit = s.as_str();
139139
NaiveDate::parse_from_str(lit, "%Y-%m-%d").context(format!(
140-
"Failed to parse value `{}` as date with format `%Y-%m-%d`",
141-
lit
140+
"Failed to parse value `{lit}` as date with format `%Y-%m-%d`"
142141
))
143142
})
144143
.collect::<Result<Vec<NaiveDate>, Error>>()
@@ -174,8 +173,7 @@ pub unsafe fn new_time_series(
174173
.map(|s| {
175174
let lit = s.as_str();
176175
NaiveTime::parse_from_str(lit, "%H:%M:%S%.f").context(format!(
177-
"Failed to parse value `{}` as time with format `%H:%M:%S.f`",
178-
lit
176+
"Failed to parse value `{lit}` as time with format `%H:%M:%S.f`"
179177
))
180178
})
181179
.collect::<Result<Vec<NaiveTime>, Error>>()
@@ -211,8 +209,7 @@ pub unsafe fn new_datetime_series(
211209
.map(|s| {
212210
let lit = s.as_str();
213211
NaiveDateTime::parse_from_str(lit, "%FT%T%.f").context(format!(
214-
"Failed to parse value `{}` as datetime with format `%FT%T%.f`",
215-
lit
212+
"Failed to parse value `{lit}` as datetime with format `%FT%T%.f`"
216213
))
217214
})
218215
.collect::<Result<Vec<NaiveDateTime>, Error>>()
@@ -282,5 +279,5 @@ pub unsafe fn new_struct_series(
282279
#[jni_fn("org.polars.scala.polars.internal.jni.series$")]
283280
pub unsafe fn show(_: JNIEnv, _: JClass, series_ptr: *mut Series) {
284281
let series = &*series_ptr;
285-
println!("{:?}", series)
282+
println!("{series:?}")
286283
}

project/GeneralSettings.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ object GeneralSettings {
3939
"-language:postfixOps",
4040
"-unchecked",
4141
"-Xfatal-warnings"
42-
) ++ (if (priorTo213(scalaVersion.value)) Seq("-target:jvm-11")
43-
else Seq("-release", "11")),
42+
) ++ (if (priorTo213(scalaVersion.value)) Seq("-target:jvm-1.8")
43+
else Seq("-release", "8")),
4444
fork := true,
4545
turbo := true,
4646
assembly / assemblyMergeStrategy := {

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
addSbtPlugin("com.github.sbt" % "sbt-jni" % "1.7.0")
22

3-
addSbtPlugin("com.github.sbt" % "sbt-java-formatter" % "0.10.0")
3+
addSbtPlugin("com.github.sbt" % "sbt-java-formatter" % "0.9.0")
44

55
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.4")
66

0 commit comments

Comments
 (0)