Skip to content

Commit

Permalink
reset to master
Browse files Browse the repository at this point in the history
  • Loading branch information
girarda committed Mar 4, 2022
1 parent 5d4f206 commit d6141ed
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ void testInterruptOrphanThreadFailure() {
3, TimeUnit.SECONDS,
10, TimeUnit.SECONDS));
try {
TimeUnit.SECONDS.sleep(15);
} catch (final Exception e) {
TimeUnit.SECONDS.sleep(10);
} catch (Exception e) {
throw new RuntimeException(e);
}
final List<Thread> runningThreads = ThreadUtils.getAllThreads().stream()
Expand All @@ -337,8 +337,8 @@ void testNoInterruptOrphanThreadFailure() {
3, TimeUnit.SECONDS,
10, TimeUnit.SECONDS));
try {
TimeUnit.SECONDS.sleep(15);
} catch (final Exception e) {
TimeUnit.SECONDS.sleep(10);
} catch (Exception e) {
throw new RuntimeException(e);
}
final List<Thread> runningThreads = ThreadUtils.getAllThreads().stream()
Expand All @@ -356,7 +356,7 @@ private void startSleepingThread(final List<Exception> caughtExceptions, final b
for (int tries = 0; tries < 3; tries++) {
try {
TimeUnit.MINUTES.sleep(5);
} catch (final Exception e) {
} catch (Exception e) {
LOGGER.info("Caught Exception", e);
caughtExceptions.add(e);
if (!ignoreInterrupt) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
#


from typing import Mapping, Any, Iterable
from typing import Any, Iterable, Mapping

from airbyte_cdk import AirbyteLogger
from airbyte_cdk.destinations import Destination
from airbyte_cdk.models import AirbyteConnectionStatus, ConfiguredAirbyteCatalog, AirbyteMessage, Status
from airbyte_cdk.models import AirbyteConnectionStatus, AirbyteMessage, ConfiguredAirbyteCatalog, Status


class DestinationScaffoldDestinationPython(Destination):
def write(
self,
config: Mapping[str, Any],
configured_catalog: ConfiguredAirbyteCatalog,
input_messages: Iterable[AirbyteMessage]
self, config: Mapping[str, Any], configured_catalog: ConfiguredAirbyteCatalog, input_messages: Iterable[AirbyteMessage]
) -> Iterable[AirbyteMessage]:

"""
Expand Down Expand Up @@ -54,6 +51,3 @@ def check(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> AirbyteConn
return AirbyteConnectionStatus(status=Status.SUCCEEDED)
except Exception as e:
return AirbyteConnectionStatus(status=Status.FAILED, message=f"An exception occurred: {repr(e)}")



Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"airbyte-cdk",
]

TEST_REQUIREMENTS = [
"pytest~=6.1"
]
TEST_REQUIREMENTS = ["pytest~=6.1"]

setup(
name="destination_scaffold_destination_python",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import io.airbyte.commons.json.Jsons;
import io.airbyte.db.Databases;
import io.airbyte.db.jdbc.JdbcDatabase;
import io.airbyte.db.jdbc.JdbcUtils;
import java.sql.SQLException;
import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -39,9 +38,9 @@ public void testEncrytion() throws SQLException {
clone.get("port").asText(),
clone.get("sid").asText()),
"oracle.jdbc.driver.OracleDriver",
JdbcUtils.parseJdbcParameters("oracle.net.encryption_client=REQUIRED&" +
"oracle.net.encryption_client=REQUIRED;" +
"oracle.net.encryption_types_client=( "
+ algorithm + " )"));
+ algorithm + " )");

final String network_service_banner =
"select network_service_banner from v$session_connect_info where sid in (select distinct sid from v$mystat)";
Expand Down Expand Up @@ -69,9 +68,9 @@ public void testCheckProtocol() throws SQLException {
clone.get("port").asText(),
clone.get("sid").asText()),
"oracle.jdbc.driver.OracleDriver",
JdbcUtils.parseJdbcParameters("oracle.net.encryption_client=REQUIRED;" +
"oracle.net.encryption_client=REQUIRED;" +
"oracle.net.encryption_types_client=( "
+ algorithm + " )"));
+ algorithm + " )");

final String network_service_banner = "SELECT sys_context('USERENV', 'NETWORK_PROTOCOL') as network_protocol FROM dual";
final List<JsonNode> collect = database.query(network_service_banner).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import io.airbyte.commons.resources.MoreResources;
import io.airbyte.db.Databases;
import io.airbyte.db.jdbc.JdbcDatabase;
import io.airbyte.db.jdbc.JdbcUtils;
import io.airbyte.integrations.base.ssh.SshHelpers;
import io.airbyte.integrations.standardtest.source.SourceAcceptanceTest;
import io.airbyte.integrations.standardtest.source.TestDestinationEnv;
Expand Down Expand Up @@ -61,8 +60,8 @@ protected void setupEnvironment(final TestDestinationEnv environment) throws Exc
config.get("port").asText(),
config.get("sid").asText()),
"oracle.jdbc.driver.OracleDriver",
JdbcUtils.parseJdbcParameters("oracle.net.encryption_client=REQUIRED&" +
"oracle.net.encryption_types_client=( 3DES168 )"));
"oracle.net.encryption_client=REQUIRED;" +
"oracle.net.encryption_types_client=( 3DES168 )");

database.execute(connection -> {
connection.createStatement().execute("CREATE USER JDBC_SPACE IDENTIFIED BY JDBC_SPACE DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON USERS");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import io.airbyte.commons.json.Jsons;
import io.airbyte.db.Databases;
import io.airbyte.db.jdbc.JdbcDatabase;
import io.airbyte.db.jdbc.JdbcUtils;
import java.sql.SQLException;
import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -39,9 +38,9 @@ public void testEncrytion() throws SQLException {
clone.get("port").asText(),
clone.get("sid").asText()),
"oracle.jdbc.driver.OracleDriver",
JdbcUtils.parseJdbcParameters("oracle.net.encryption_client=REQUIRED&" +
"oracle.net.encryption_client=REQUIRED;" +
"oracle.net.encryption_types_client=( "
+ algorithm + " )"));
+ algorithm + " )");

final String network_service_banner =
"select network_service_banner from v$session_connect_info where sid in (select distinct sid from v$mystat)";
Expand Down Expand Up @@ -88,9 +87,9 @@ public void testCheckProtocol() throws SQLException {
clone.get("port").asText(),
clone.get("sid").asText()),
"oracle.jdbc.driver.OracleDriver",
JdbcUtils.parseJdbcParameters("oracle.net.encryption_client=REQUIRED&" +
"oracle.net.encryption_client=REQUIRED;" +
"oracle.net.encryption_types_client=( "
+ algorithm + " )"));
+ algorithm + " )");

final String network_service_banner = "SELECT sys_context('USERENV', 'NETWORK_PROTOCOL') as network_protocol FROM dual";
final List<JsonNode> collect = database.query(network_service_banner).collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public JsonNode toDatabaseConfig(final JsonNode redshiftConfig) {

addSsl(additionalProperties);

builder.put("connection_properties", String.join("&", additionalProperties));
builder.put("connection_properties", String.join(";", additionalProperties));

return Jsons.jsonNode(builder
.build());
Expand All @@ -74,15 +74,15 @@ private void addSsl(final List<String> additionalProperties) {
}

@Override
public List<TableInfo<CommonField<JDBCType>>> discoverInternal(final JdbcDatabase database) throws Exception {
public List<TableInfo<CommonField<JDBCType>>> discoverInternal(JdbcDatabase database) throws Exception {
if (schemas != null && !schemas.isEmpty()) {
// process explicitly selected (from UI) schemas
final List<TableInfo<CommonField<JDBCType>>> internals = new ArrayList<>();
for (final String schema : schemas) {
for (String schema : schemas) {
LOGGER.debug("Discovering schema: {}", schema);
internals.addAll(super.discoverInternal(database, schema));
}
for (final TableInfo<CommonField<JDBCType>> info : internals) {
for (TableInfo<CommonField<JDBCType>> info : internals) {
LOGGER.debug("Found table (schema: {}): {}", info.getNameSpace(), info.getName());
}
return internals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.fasterxml.jackson.databind.JsonNode;
import io.airbyte.db.Databases;
import io.airbyte.db.jdbc.JdbcDatabase;
import io.airbyte.db.jdbc.JdbcUtils;
import io.airbyte.integrations.source.redshift.RedshiftSource;

public class RedshiftSslSourceAcceptanceTest extends RedshiftSourceAcceptanceTest {
Expand All @@ -22,8 +21,8 @@ protected JdbcDatabase createDatabase(final JsonNode config) {
config.get("port").asText(),
config.get("database").asText()),
RedshiftSource.DRIVER_CLASS,
JdbcUtils.parseJdbcParameters("ssl=true&" +
"sslfactory=com.amazon.redshift.ssl.NonValidatingFactory"));
"ssl=true;" +
"sslfactory=com.amazon.redshift.ssl.NonValidatingFactory");
}

}

0 comments on commit d6141ed

Please sign in to comment.